ng-grid

Angular ngGrid select row on page load

两盒软妹~` 提交于 2019-12-30 04:04:08
问题 My question is an extension to thisquestion Getting select rows from ng-grid? plunker - http://plnkr.co/edit/DiDitL?p=preview I need a row to be selected on page load and I need to avoid listening to 'ngGridEventData' calling $scope.gridOptions.selectRow(2, true); in the controller body fails since the grid has not been loaded. avoiding listening to ngGridEventData is due to the fact that I need the controller to listen to an event triggered before and based on that I need to select the

Angular ngGrid select row on page load

瘦欲@ 提交于 2019-12-30 04:04:06
问题 My question is an extension to thisquestion Getting select rows from ng-grid? plunker - http://plnkr.co/edit/DiDitL?p=preview I need a row to be selected on page load and I need to avoid listening to 'ngGridEventData' calling $scope.gridOptions.selectRow(2, true); in the controller body fails since the grid has not been loaded. avoiding listening to ngGridEventData is due to the fact that I need the controller to listen to an event triggered before and based on that I need to select the

Custom “cellfilter” in Angular js

五迷三道 提交于 2019-12-25 12:12:23
问题 I am working with the ng-grid in Angular js. I have this line of code which defines the type of filter added. columnDefs: [{field:'date', displayName:'Birth Date', cellFilter:'date:\"dd MMM yyyy\"'}, {field:'pre', displayName:'Prev', cellFilter:'number'}, {field:'fct', displayName:'Fct', cellFilter:'number'}, {field:'act', displayName:'Act', cellFilter:'number'} {field:'imp', displayName:'Important', cellFilter:'number'}] }; the Important column has values "H" "L" and "M". By normal

Custom “cellfilter” in Angular js

北慕城南 提交于 2019-12-25 12:11:08
问题 I am working with the ng-grid in Angular js. I have this line of code which defines the type of filter added. columnDefs: [{field:'date', displayName:'Birth Date', cellFilter:'date:\"dd MMM yyyy\"'}, {field:'pre', displayName:'Prev', cellFilter:'number'}, {field:'fct', displayName:'Fct', cellFilter:'number'}, {field:'act', displayName:'Act', cellFilter:'number'} {field:'imp', displayName:'Important', cellFilter:'number'}] }; the Important column has values "H" "L" and "M". By normal

Wrapping words in the ng-grid's header

試著忘記壹切 提交于 2019-12-25 02:29:19
问题 I've got pretty long column titles in my ng-grid and trying to wrap words there. I've been dancing around custom 'headerCellTemplate' for some time and now words are wrapped, but I can't reach the adequate header height. I guess it coming from the 'overflow' CSS property, but all my efforts about it were failed. Is there an easy way to wrap these words? Here is the plunker: http://plnkr.co/edit/TnK8pl?p=preview 回答1: Just set the headerRowHeight in gridOptions: $scope.gridOptions = { data:

Angular ng-grid in a nested tab

一笑奈何 提交于 2019-12-25 02:22:06
问题 I have an app based on this plunk. My app has grown & it probably too large & complex to post here, so let's just continue to discuss the Plunk on which it is based. Basically, I just want to use an ng-grid, which I will populate with JSON data received from a server, on one of the nested tabs. That wasn't working, so I tried to simplify the problem by using the exact code of the ng-grid example (see http://angular-ui.github.io/ng-grid/). That still wasn't working, so I tried to simplify the

nggrid how can I disable/enable individual column

丶灬走出姿态 提交于 2019-12-25 02:18:17
问题 I have a nggrid with a name and an age column with some data. so it looks like this: Name | Age 50 | 50 : age field has green background because name and age col have same value How can I make the age column editable/noneditable depending on the namecolumn value in this row? see also: http://plnkr.co/edit/OxJqS5LYOvG2vx0Ujhu7?p=preview 回答1: You can use cellEditableCondition on a per-column basis within the columnDefs like so: cellEditableCondition: 'row.getProperty(\'name\') == row

How to filter the NG-Grid by dropdown values

為{幸葍}努か 提交于 2019-12-24 21:26:52
问题 I have a drop down menu which get populated from Nggrid Column. The dropdown is a separate control. I want to filter the NG-grid based on the value selected from drop down value. How do I do this? 回答1: you could add an ng-change to your select like this: select(ng-model="search", ng-options="data in datas", ng-change='myfilter()') and in your controller: $scope.myfilter = function() { $scope.datas = $filter('filter')($scope.datas, {data.YourField: $scope.search}); // or: // $scope.datas =

How can I get server-side-pagination in ng-grid in AngularsJS

谁说胖子不能爱 提交于 2019-12-24 17:09:27
问题 I have a ng-grid in angular application ,the data coming to grid from database by calling the web-services .services are 1. (GET) getAllCustomerListCount which gives integer number like 6202. 2. (GET) getAllCustomerListByRange which takes two parameters like startFrom parameter takes integer which represent starting or begin range to display ,and another parameter noOfRecords takes integer which represent no.of records to display . As of now i am calling the getAllCustomerListCount first to

Disable filtering on a column in ng-grid

我只是一个虾纸丫 提交于 2019-12-24 15:21:25
问题 I want ng-grid not to search based on specific columns, but I do want those columns to still be sortable. Is there a way to accomplish this? 回答1: Sorry I'm late, meetings all day:-\ Got this running with a modfied version of my answer example from here. This one is based on the official server sided pagination example from here. I changed the code in $scope.getPagedDataAsync to include this filtering function: if (searchText) { var ft = searchText.toLowerCase(); data = $scope.longData.filter