ng-grid

Can I use entered value through ng-model to populate angular ng grid?

廉价感情. 提交于 2020-04-30 14:27:40
问题 This plunker populates a static Html Table correctly based on a search for 'Tim' (Json Data). var arrItem = []; angular.forEach($scope.items, function (item) { if(item.fname === enteredValue.firstName || item.lname === enteredValue.lastName ||item.address === enteredValue.address && item.phone === enteredValue.phone){ arrItem.push({ first: item.fname, last: item.lname, address: item.address, phone: item.phone }); Now I want to place this data in a NG-Grid. This plunker attempts to load this

ng-grid cellTemplate doesn't work with CUSTOM_FILTERS included

浪尽此生 提交于 2020-01-14 12:54:09
问题 When including a cellTemplate in a column definition, if that cellTemplate includes CUSTOM_FILTERS, it causes angular to puke: Error: Syntax Error: Token 'CUSTOM_FILTERS' is an unexpected token at column 14 of the expression [row.entity.1 CUSTOM_FILTERS] starting at [CUSTOM_FILTERS] Even using the default cellTemplate in a column def results in the same error. cellTemplate = "<div class=\"ngCellText\" ng-class=\"col.colIndex()\"><span ng-cell-text>{{COL_FIELD CUSTOM_FILTERS}}</span></div>"

Getting select rows from ng-grid?

旧城冷巷雨未停 提交于 2020-01-09 19:52:47
问题 How do I create (or access) an array of selected rows in my ng-grid? Documentation (scroll to "Grid options") id | default value | definition ----------------------------------------------- selectedItems | [] | all of the items selected in the grid. In single select mode there will only be one item in the array. index.html <body ng-controller="MyCtrl"> <div class="gridStyle" ng-grid="gridOptions"></div> <h3>Rows selected</h3> <pre>{{selectedItems}}</pre> </body> main.js var app = angular

I how to display grid based on condition with checked selected (tick mark)

我与影子孤独终老i 提交于 2020-01-06 04:28:11
问题 In html page i am displaying the drop down ,the item in the drop down are dynamic ,and below the drop down displaying the ng-grid data with check boxes these are also dynamic ,the dynamic drop down has the j son data as [ { "c": "D", "l": 1, "cId": 1 }, { "c": "J", "l": 2, "cId": 3 }, { "c": "G", "l": 3, "cId": 1 } ] In drop down i have displayed only property "c" value . The dynamic grid had dynamic j son data as [ { "c": "U t", "cC": "Ut", "cId": 1 }, { "c": "Ca", "cC": "CA", "cId": 2 }, {

ng-grid hiding bootstrap styled dropdowns

可紊 提交于 2020-01-04 02:32:05
问题 I am upgrading a table form. Each row in the table has several elements, including two drop downs in specific columns for each row. I have upgraded the table to ng-grid and upgraded the drop-downs from plain select widgets to styled bootstrap drop-down elements to match the others on the site. The essential problem I am having is that the CSS layout of ng-grid causes the actual drop down menu to be put behind the cell below, and so not visible. Examining the elements shows that they are

How to hide column in ng grid

六月ゝ 毕业季﹏ 提交于 2020-01-02 00:12:51
问题 here is my code: index.html <!DOCTYPE html> <html ng-app="myApp"> <head> <meta charset="utf-8" /> <title>AngularJS Plunker</title> <link rel="stylesheet" type="text/css" href="http://angular-ui.github.com/ng- grid/css/ng-grid.css" /> <link rel="stylesheet" type="text/css" href="style.css" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.2/angular.min.js"></script> <script type="text

ngGrid - remove row

只谈情不闲聊 提交于 2019-12-31 14:54:24
问题 I have been looking for an example on how to implement a button to remove a selected row, but I couldn't find anything useful so far. Can anyone please give me a hint? Here is the plunker example. The function I implement acts weird, as it removes other rows. Thank you. 回答1: That is not a proper way to delete any row Try like this: $scope.removeRow = function() { var index = this.row.rowIndex; $scope.gridOptions.selectItem(index, false); $scope.myData.splice(index, 1); }; PLUNKER --> Its

Ng-grid insert several items to cell

人走茶凉 提交于 2019-12-31 02:43:28
问题 How to insert several values to 1 cell for example email, phone and address to 1 cell. I need to make less rows and more info in cells. I tried such way: angular.forEach($scope.genData,function(row){ row.getNameAndAge = function(){ return this.name + '-' this.age ; } }); and seted: columnDefs: [ {field:'getNameAndAge()', displayName:'Contacts'} ] but it don't work for me. My JSON: { "picture": "http://placehold.it/32x32", "about": "Laboris do in mollit nostrud sit tempor ad velit. Duis

ngGrid sort entire result set

此生再无相见时 提交于 2019-12-30 10:17:53
问题 I would like on the ngGridSorted event to sort the entire result set (not just the page) by the sort function that was clicked on. Is there an easy way to do this? I haven't seen a good example of how to sort anything but the page that the user is currently on. 回答1: In fact you just can use the server-side paging option without actually having serversided code. The example on the ng-grid demos also just loads a big json file. The function you need to rewrite is: $scope.getPagedDataAsync =

ngGrid sort entire result set

◇◆丶佛笑我妖孽 提交于 2019-12-30 10:17:49
问题 I would like on the ngGridSorted event to sort the entire result set (not just the page) by the sort function that was clicked on. Is there an easy way to do this? I haven't seen a good example of how to sort anything but the page that the user is currently on. 回答1: In fact you just can use the server-side paging option without actually having serversided code. The example on the ng-grid demos also just loads a big json file. The function you need to rewrite is: $scope.getPagedDataAsync =