ng-grid – Dynamically Setting Group by One or More Fields

Tuesday, June 17, 2014

in one of LogoUi’s projects we had a requirement for dynamically grouping data,  trying to dynamically group data using the group property , is ignored, so after examining the ng-grid internal code, i found a solution. Setting group by one field for grouping by one field, in grid options object you need to call the groupBy function and pass the field as a string argument . Example:html: <div ng-controller="MyCtrl"> <button type="button" ng-click="changeGroupBy('name')">Group By Name</button> <button type="button" ng-click="changeGroupBy('age')">Group By Age</button> <div class="gridStyle" ng-grid="gridOptions"></div> </div> JavaScript: app.controller('MyCtrl', function($scope) { $scope.myData = [{"name": "Moroni", "age": 50}, ...
one comment

ng-grid – Single Row Selection for Multiple Checkbox Plugin

Monday, May 5, 2014

After working with ng-grid for awhile, I realized that single selection property is missing on configuration options when  multiple checkbox select (“select all” checkbox) is needed.I know it’s confusing, so lets take one step at a time and demonstrate what i mean, we’ll take a simple ng-grid and add the showSelectionCheckbox property. $scope.gridOptions = { data: 'myData', showSelectionCheckbox: true };   Live example: as you can see by default you have a multiple select but it’s not the desired result since we want a single row select, okay, so lets add the multiSelect property and set it to...
3 comments