ng-grid

How to do client-side pagination with ngGrid?

风流意气都作罢 提交于 2019-12-04 03:22:51
问题 If you set the enablePaging options of an ng-grid to true , you enable server-side pagination. What about client-side one? I could not find any hint on this in the documentation, but I can not imagine that ng-grid does not support client-side paging as well. Any hint? 回答1: I think the example given on the angular page (http://angular-ui.github.io/ng-grid/) actually shows an example of client-side paging. If you look at the data load that is being called by the sample script (http://angular-ui

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; }

How to display Yes/No instead of True/False in AngularJS [closed]

人走茶凉 提交于 2019-12-04 01:52:35
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . I am using the cellTemplate to display the data in grid ,now i have to display the data in ng-grid ,where i can display the data containing true or false value in one column ,please guide me how to display the true or false data like yes or no ,i.e ,for true value i have to display yes and for false value to no

Change the MenuItem icon in angular ui.gird

戏子无情 提交于 2019-12-03 21:39:39
How to toggle the customizing_column_menu icons in angular ui.grid like shown below I didn't found any best solution to change menuItems dynamically, Here is what I did for workaround Code $scope.gridOptions = { rowHeight: 75, columnDefs: [{ field: 'name', enableColumnMenu: false }, { field: 'gender', enableHiding: false, suppressRemoveSort: true, sort: { direction: uiGridConstants.ASC } }, { field: 'All Details', cellTemplate: '<p ng-show="grid.appScope.company"><label><b>Company:</b></label><span>{{row.entity.company}}</span></p><p ng-show="grid.appScope.email"><label><b>email:</b></label>

how to create a nggrid custom footer

余生长醉 提交于 2019-12-03 12:02:53
问题 I want to enable footers for ng-grid but I want to completely customize it and override what ng-grid does by default. Basically, I just want a 'Load more...' link at at the bottom of the grid that will load more rows from the server according to what pagingOptions.pageSize is set to and append it to the bottom of the grid while dynamically expanding the viewport height so there is no scrollbar. Is there a configuration hook for this, or where/how can I do this? Thanks. 回答1: Although it is not

How do I scroll an ngGrid to show the current selection?

冷暖自知 提交于 2019-12-03 09:32:45
问题 I'm setting the selection of my ngGrid from JavaScript, calling gridOptions.selectItem() . I have multiSelect set to false, so there is only ever one row selected. I'd like the ngGrid to automatically scroll to show the newly selected row, but I don't know how to do this: can anyone help, please? On a related topic: can I disable row selection by mouse click? If so, how? Edited to add I'd also like to disable keyboard navigation of the selected row, if possible. What worked: AardVark71's

ng-grid/ui-grid celltemplate on click causes row to be selected.

匿名 (未验证) 提交于 2019-12-03 08:54:24
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When I use celltemplate for ahref link, once the link is clicked the row highlights because i have RowSelection enabled...but i dont want the row to highlight when the link is clicked..only if the row is clicked anywhere but the link. Also in my below example picture, how do I remove the little arrow so no Menuitems can be displayed for that column? Code: $scope.gridOptions = { showFooter: true, enableFiltering: true, enableRowSelection: true, enableRowHeaderSelection: false, enableSelectAll: true, multiSelect: true, enableColumnResizing:

AngularJS: change color of a cell based on a condition ng-grid

痴心易碎 提交于 2019-12-03 08:52:34
Here is the plnkr code. I want to change the color of the age cell for all the rows that their alert property is true. I am not sure how to do it. I don't have a separate column for the alert. Here you go. Refer this modified PLUNKER . Escaping single quote here but indenting the template for better readability. <div class="ngCellText" ng-class="{\'green\': row.getProperty(\'alert\') == \'true\' }"> {{ row.getProperty(col.field) }} </div> Above case is when alert is the string representation of booleans ("true"/"false"). When alert is boolean, then the template becomes less clumsy: <div class=

Dynamically Change the Grid Options in angular ui.grid

别来无恙 提交于 2019-12-03 08:46:22
I have to show two types of gridOptions without using two grid's trying to change the gridOptions dynamically not working(one time working). working example http://plnkr.co/edit/4QKGIB?p=preview . $scope.grid1=function(){ $scope.gridOptions = $scope.gridOptions1; $scope.gridApi.core.notifyDataChange(uiGridConstants.dataChange.ALL); } $scope.grid2=function(){ $scope.gridOptions = $scope.gridOptions2; $scope.gridApi.core.notifyDataChange(uiGridConstants.dataChange.ALL); } Basically you need to use angular.copy() while assigning columnDef to grid, which clones the array and set it to the

Get Ajax data into Angular grid

被刻印的时光 ゝ 提交于 2019-12-03 08:37:56
问题 Using Angular Grid, I get the ajax get data in console.log. But an empty grid. The console log reads: [13:56:11.411] now!! [13:56:11.412] [] [13:56:11.412] now!! [13:56:11.556] <there is data returned from console.log(getData); > This is the js file. // main.js var app = angular.module('myApp', ['ngGrid']); var getData = []; function fetchData() { var mydata = []; $.ajax({ url:'/url/to/hell', type:'GET', success: function(data) { for(i = 0, j = data.length; i < j; i++) { mydata[i] = data[i];