ng-grid

Scope confusion in ng-grid when returning data from modal

牧云@^-^@ 提交于 2019-12-02 01:21:22
Here is the Plunker: http://plnkr.co/edit/aqLnno?p=preview I have a list of persons ( $scope.persons ) to be displayed in a ng-grid. Each line has a edit button. When the user clicks on the button ( ng-click="edit(row)" ) (see code below), I copy the displayed person ( angular.copy(row.entity) ) and open a modal dialog. ... so far so good. When the user clicks "Cancel" on the modal, nothing happens. When the user clicks "Save" on the model, the modified person is returned and should be "reintegrated" in $scope.persons . This is where the problem starts: I search in $scope.persons to find the

Ng-grid insert several items to cell

时光总嘲笑我的痴心妄想 提交于 2019-12-02 00:29:05
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 excepteur ex voluptate dolore elit ad non aliqua. Dolore pariatur non sit eiusmod irure. Aliquip anim officia

How to do client-side pagination with ngGrid?

岁酱吖の 提交于 2019-12-01 17:16:42
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? 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.github.io/ng-grid/jsonFiles/largeLoad.json ), you'll see that its not actually doing any server-side

ng-grid how to show/hide button in a column cell for last row

若如初见. 提交于 2019-12-01 14:24:35
I have a ng-grid table and one of the column Defs has a cell template to show icon. Currently icon shows up across all rows. Can anyone help me how to display icon for the last row in ng-grid. I tried using ng-show='$last' and didn't work. $scope.reasonsGrid = { data: 'myReasons', columnDefs: [ {field: 'add', displayName:'', cellTemplate: addTemplate,enableCellEdit: false,width:30}, {field: 'code', displayName: 'Reasons',cellTemplate: dropdownTemplate,enableCellEdit: false}] }; var addTemplate ='span class="glyphicon glyphicon-plus-sign" ng-click="addItem(row.rowIndex)" ng-show="$last"/>';;

ng-grid how to show/hide button in a column cell for last row

Deadly 提交于 2019-12-01 12:39:11
问题 I have a ng-grid table and one of the column Defs has a cell template to show icon. Currently icon shows up across all rows. Can anyone help me how to display icon for the last row in ng-grid. I tried using ng-show='$last' and didn't work. $scope.reasonsGrid = { data: 'myReasons', columnDefs: [ {field: 'add', displayName:'', cellTemplate: addTemplate,enableCellEdit: false,width:30}, {field: 'code', displayName: 'Reasons',cellTemplate: dropdownTemplate,enableCellEdit: false}] }; var

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

对着背影说爱祢 提交于 2019-12-01 11:29:53
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 .please guide me what changes in makes my required result. mainguy Create a simple filter like: app.filter('true_false', function() { return function(text, length, end) { if (text) { return 'Yes'; } return 'No'; } }); and use it in your cellTemplate (or wherever you want): cellTemplate:

ng-grid expand and collaspe row

旧街凉风 提交于 2019-12-01 04:13:59
I am trying to achieve an expand and collapse row for ng-grid, basically what we have here http://datatables.net/examples/api/row_details.html if you click the "plus icon" your displayed with more detail. I have seen a similar question asked here but no solution. https://github.com/angular-ui/ng-grid/issues/517 Does anyone know how to achieve this? Any help is appreciated. var app = angularexpand('myApp', ['ngGrid']); app.controller('MyCtrl', function($scope) { $scope.myData = [{ somedata: "data to be expanded in another", moredata: 1 }, { somedata: "b data to be expanded in another", moredata

Make only some cells editable in ngGrid?

时光怂恿深爱的人放手 提交于 2019-12-01 03:28:31
问题 I have an ngGrid that shows a few records with basically key / value content. Now, I would like to make some of these records editable. Using the enableCellEditing features of ngGrid, I can enable or disable editin for a complete column - but what if I only want to enable it for some rows in that column? Is there any way to dynamically configure this for each row? 回答1: Late answer, but ng-grid (which is now being redone as ui-grid ) now has a cellEditableCondition that you can use to make

ng-grid expand and collaspe row

青春壹個敷衍的年華 提交于 2019-12-01 01:54:27
问题 I am trying to achieve an expand and collapse row for ng-grid, basically what we have here http://datatables.net/examples/api/row_details.html if you click the "plus icon" your displayed with more detail. I have seen a similar question asked here but no solution. https://github.com/angular-ui/ng-grid/issues/517 Does anyone know how to achieve this? Any help is appreciated. var app = angularexpand('myApp', ['ngGrid']); app.controller('MyCtrl', function($scope) { $scope.myData = [{ somedata:

How to render html formatted text in ng-grid column header

◇◆丶佛笑我妖孽 提交于 2019-12-01 00:45:39
I have 5 column names in a config file which I read into an array called columns in javascript. var columns = []; var columnNames = []; var columnCount = 5; $scope.nettingGridOptions = { data : 'tableData', columnDefs: 'columnNames' } Next, I just iterate through the columns array and assign values in columnNames array so that my ng-grid starts showing correct displayName . for(i=0;i<columnCount;i++) { columnNames[i] = { field: i, displayName: columns[i], headerClass : "myPersonalHeaderClass"}; } The issue I have is that the column names are too big. I want to split a column name (for example