angular-ui-grid

Pre-Select rows on load with angular-ui-grid

只谈情不闲聊 提交于 2019-12-04 09:09:24
I want to select certain rows on page load(working days) This is the plunker plnkr.co/edit/48NyxngWNGIlOps1Arew?p=preview Any suggestion? Add the following property to your $scope.gridOptions object : onRegisterApi: function(gridApi) { $scope.gridApi = gridApi; $scope.gridApi.grid.modifyRows($scope.gridOptions.data); $scope.gridApi.selection.selectRow($scope.gridOptions.data[0]); } This sets a $scope.gridApi so you can access it if you need it outside of this function. You need to call the modifyRows method in order to be able to make changes to your rows. Then the first row is selected (just

Any better approaches in achieving multi-column grouping in UI-Grid header?

一曲冷凌霜 提交于 2019-12-04 08:07:59
I've tried to achieve the multi column grouping at column header level for UI-Grid with the below approach. Steps I've followed: Include the below header cell template, of the UI grid, with another "UI Grid row": <div class="ui-grid-header custom-ui-grid-header"> <div class="ui-grid-top-panel"> <div class="ui-grid-header-viewport"> <div class="ui-grid-header-canvas"> <div class="ui-grid-header-cell-wrapper" ng-style="colContainer.headerCellWrapperStyle()"> <div class="ui-grid-header-cell-row"> <div class="ui-grid-header-cell" ng-repeat="superCol in grid.options.superColDefs track by $index"

How do I add image in a angular ui-grid cell

吃可爱长大的小学妹 提交于 2019-12-04 07:47:28
How do I add image in a angular ui-grid cell. var app = angular.module('app', ['ngAnimate', 'ngTouch', 'ui.grid']); app.controller('MainCtrl', ['$scope', '$http', function ($scope, $http) { $scope.gridOptions = { enableSorting: true, columnDefs: [ { field: 'name' }, { field: 'company' }, { field: 'image'} ], data:[ {name:"Name1",company:"Company1",image:"http://cdn.flaticon.com/png/256/70689.png"}, {name:"Name2",company:"Company2",image:"http://cdn.flaticon.com/png/256/70689.png"},] }; }]); You can use a custom cell template to render the image in the cell. var app = angular.module('app', [

Angular ui-grid line selection is not working

你说的曾经没有我的故事 提交于 2019-12-04 06:19:27
问题 I'm trying to select the first rendred line using Angular ui-grid but it's not working. Here is a plunker with the example. I was able to do it using timeout after rendering data from the server but not using $scope.gridApi.grid.modifyRows($scope.gridOptions.data); $scope.gridApi.selection.selectRow($scope.gridOptions.data[0]); as shown in different example. would you please help me fixing it? 回答1: If the data is getting loaded by an async call you can select the rows in the callback, you can

Angular ui-grid can not copy cell text

折月煮酒 提交于 2019-12-04 06:16:17
I have an ui-grid where I want to select row by clicking any where on any row. I also want to copy a cell content to clip board. I did the following code, but while enableFullRowSelection is true , I can not select cell content by mouse draging. Please see the plunker . After further investigating I found .ui-grid-disable-selection class is being added to my grid. So can any one suggest how to solve this? EDIT : If I change enableFullRowSelection to false , I can select the content. var app = angular.module('plunker', ['ui.grid', 'ui.grid.selection']); app.controller('MainCtrl', function(

Remove extra column of icons from Angular UI-Grid TreeView

不羁的心 提交于 2019-12-04 05:58:32
问题 I want to remove extra column of icons for expand and collapse and merge it with my main treebase column. Plunkr Source In the following link you can see that on a tree view it creates extra column for expansion and collapse but i want to merge it with my first column (name) and i also want to change the icon. Please help me that how can i achieve that. onRegisterApi: function( gridApi ) { $scope.gridApi = gridApi; $scope.gridApi.treeBase.on.rowExpanded($scope, function(row) { if( row.entity.

How to stop infinite scrolling of ui-grid while content loading finish?

£可爱£侵袭症+ 提交于 2019-12-04 05:16:11
问题 I am using ui-grid. I have already implemented some logic to stop the $http call as follows. But when it reaches last result the scroll is jumping to the row which are few before of last results. So User can not see the last results any time. If User scroll again then after a while It jumps again to the row which are few before of last results. I used following logic. $scope.loadMoreData = function() { var promise = $q.defer(); if($scope.lastPage < $scope.maxPage){ $timeout(function () { var

Copy angular-ui-grid fonts into .tmp/fonts

試著忘記壹切 提交于 2019-12-04 04:04:32
问题 I was experiencing a known issue with Angular UI Grid where some of my fonts would look Korean in production. I applied a certain fix by adding the following CSS: @font-face { font-family: 'ui-grid'; src: url('../fonts/ui-grid.eot'); src: url('../fonts/ui-grid.eot#iefix') format('embedded-opentype'), url('../fonts/ui-grid.woff') format('woff'), url('../fonts/ui-grid.ttf?') format('truetype'), url('../fonts/ui-grid.svg?#ui-grid') format('svg'); font-weight: normal; font-style: normal; } This

Column header wrapping when using Angular ui-grid

与世无争的帅哥 提交于 2019-12-04 02:59:32
I have upgraded my AngularJS SPA application from ng-grid v2.0.7 to ui-grid v3 and my column headers no longer wrap around. My column headers are now single lined and show an ellipsis ... when the column header doesn't fit. Has this feature been removed or is had it been superseded by a different method? I believe I have found a way of wrapping text in the header columns by overriding the ui-grid-cell-contents CSS class. .ui-grid-header-cell .ui-grid-cell-contents { height: 48px; white-space: normal; -ms-text-overflow: clip; -o-text-overflow: clip; text-overflow: clip; overflow: visible; }

ng-click inside cell template does not trigger function in controller

杀马特。学长 韩版系。学妹 提交于 2019-12-03 23:52:48
I have created a plunker here: http://plnkr.co/edit/zGqouwzxguef13lx48iP?p=preview When I click in a cell of the ui-grid in the day view then nothing happens. What I expected is that the test function is executed and an alert is shown with text 'test' but that is not the case. What is going on wrong here? Thats the html cell template of the ui-grid 3.0 latest release: HTML <div ng-click="test()" ng-switch="row.entity[row.grid.columns.indexOf(col)].isPeriod"> <div ng-switch-when="true"> <tabset> <tab> <tab-heading> <i class="glyphicon glyphicon-book"></i> </tab-heading>period id: {{ row.entity