angular-ui-grid

How to use refresh method in ui-grid?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 22:43:46
I am trying to update visibility option in the columDefs of my ui-grid. After updating the value I need to refresh my ui-grid. What is the way to refresh my grid from my controller? Jose Visit this pages: GetAPI - http://ui-grid.info/docs/#/api/ui.grid.class:GridApi Specific API - http://ui-grid.info/docs/#/api/ui.grid.core.api:PublicApi http://ui-grid.info/docs/#/api/ui.grid.class:GridApi After having instantiated your gridApi, you can just call: //instantiate (not so obvious) // whatever scope attribute your binding to gridOptions $scope.gridOptions = { onRegisterApi: function(gridApi){

Where can I get Angular ui-grid selected items

时间秒杀一切 提交于 2019-11-28 21:06:14
Testing out Angular ui-grid (ng-grid v.3.0). Can not for the life of me find the selected row. I just want to grab the rows or even row ID of row when a user clicks it. Found the top comment here but I think this is outdated: Getting select rows from ng-grid? Does anyone know where the gridOptions.selectedItems is being stored in 3.0? Is this what your are looking for ? http://ui-grid.info/docs/#/tutorial/210_selection Activate grid selection capabilities with the ui-grid-selection tag (and ui.grid.selection module registration in your app register gridApi and use gridApi.selection to access

How to color row on specific value in angular-ui-grid?

对着背影说爱祢 提交于 2019-11-28 19:26:16
I'm trying to color a row depending on it's value in the new angular-ui-grid 3.0 rc12 but I haven't been able to. The following code used to work in the previous version (ngGrid): $scope.gridOptions = data: 'data.sites' tabIndex: -1 enableSorting: true noTabInterference: true enableColumnResizing: true enableCellSelection: true columnDefs: [ {field: 'sv_name', displayName: 'Nombre'} {field: 'sv_code', displayName: 'Placa'} {field: 'count', displayName: 'Cuenta'} ] rowTemplate: """<div ng-class="{green: true, blue: row.getProperty('count') === 1}" ng-repeat="col in colContainer.renderedColumns

I want to write a custom directive for ui-grid with different input columnDefs

余生长醉 提交于 2019-11-28 02:13:15
问题 This is my Controller $scope.usersList = {}; $scope.usersList = { paginationPageSizes: [10,15, 20], paginationPageSize: 10, columnDefs: [ { name: 'userId', cellTemplate: '<div class="ui-grid-cell-contents"><a ui-sref="appSetting.userSelected({userId: row.entity.userId})">{{ row.entity.userId }}</a></div>' }, { name: 'firstName' }, { name: 'lastName' }, { name: 'emailId' }, { name: 'action', cellTemplate: '<div>' + ' <button ng-click="grid.appScope.sampledetails()">Delete</button>' + '</div>',

Angular ui-grid events in cell header not firing

佐手、 提交于 2019-11-27 23:41:06
问题 I'm using a headerCellTemplate in the columDefs of my ui-grid (not ng-grid but the new rewrite). In the html I have a checkbox. Essentially I am trying to add a checkbox in the header of a column that is all checkboxes so I can check all/none. The cell renders fine with the checkbox. The problem is that the ng-change in the checkbox in the header never fires the event. Additionally the ng-model value never changes. Looking at the code there is a directive used called uiGridHeaderCell so I

AngularJS : How to access scope from ui-grid cell template?

北慕城南 提交于 2019-11-27 20:22:56
How does one access $scope from a ui-grid cell template? Here's my controller code: app.controller('MainCtrl', ['$scope', function ($scope) { // i want to reference this from a cell template. $scope.world = function() { return 'world'; }; $scope.gridOptions = { data: [ { id: "item1" }, { id: "item2" } ], columnDefs: [ { field: 'id', // world() is never called and is not displayed. cellTemplate: '<div>{{ "hello " + world() }}</div>' }] }; }]); See it in action here: http://plnkr.co/edit/WYXeQShHWKDYDs4MIZnP?p=preview I would expect cell contents to show "hello world", but they just show "hello"

Conditional cell template in ui-grid angularjs

妖精的绣舞 提交于 2019-11-27 19:29:16
How to add conditional when showing data in ui-grid cellTemplate below: $scope.status = ['Active', 'Non Active', 'Deleted']; $scope.gridOptions = { columnDefs: [{ field: 'code' }, { field: 'name' }, { field: 'status', cellTemplate: '<div>{{status[row.entity.status]}}</div>' }] }; The expected result should be row status show Active/NonActive/Deleted . Here is the plunker Thanks in advance. You have to use externalScopes . In your markup define the gridholder like this. <div ui-grid="gridOptions" external-scopes="states" class="grid"></div> And in your controller use this code: var statusTxt =

Angular ui-grid dynamically calculate height of the grid

坚强是说给别人听的谎言 提交于 2019-11-27 18:19:27
I am using : https://github.com/angular-ui/ui-grid.info/tree/gh-pages/release/3.0.0-RC.18 <div ui-grid="gridOptions" style="height:765px"></div> When I hard code the value, as shown above, the grid spreads out and everything works as expected. However, if I do the following... $scope.gridStyle = 'height:'+numRows*rowHeight+'px' //(765px); <div ui-grid="gridOptions" style="{{gridStyle}}"></div> The height is printed in the div and div widens but the content itself widens to only around 340px. The space that is left is blank, so instead of 25 rows I see only 8. I have to scroll down, while there

How to use refresh method in ui-grid?

余生颓废 提交于 2019-11-27 14:25:47
问题 I am trying to update visibility option in the columDefs of my ui-grid. After updating the value I need to refresh my ui-grid. What is the way to refresh my grid from my controller? 回答1: Visit this pages: GetAPI - http://ui-grid.info/docs/#/api/ui.grid.class:GridApi Specific API - http://ui-grid.info/docs/#/api/ui.grid.core.api:PublicApi http://ui-grid.info/docs/#/api/ui.grid.class:GridApi After having instantiated your gridApi, you can just call: //instantiate (not so obvious) // whatever

angular ui grid save and restore state

。_饼干妹妹 提交于 2019-11-27 13:50:52
问题 I need to know how to implement save and restore state in angularui grid without using any buttons. I need to save the state automatically when ever we do any changes in the grid. We have to auto restore the saved state also. Even if we refresh the page the saved state should be restored 回答1: Here's what I figured out. I couldn't find a single event for grid state changes, but It does look like they have individual events for almost everything. Here are a few that i'm using. I just set a