angular-ui-grid

Directive rendered via UI-Grid cellTemplate rendering incorrectly

烂漫一生 提交于 2019-12-10 15:22:15
问题 I am experiencing a strange issue in that my directive seems to be executing on stale row.entities, meaning it does not get the new values as you scroll down or modify the sort of the grid. The initial ~20 rows render fine but past that the directives become disassociated with the rows. See my very hacked together example here. 回答1: It looks like during sort values of the expression you pass to directive change, but the expression itself stays the same. You should change scope & expression

Can Angular-UI-Grid-Edit be used with “controller as” syntax?

核能气质少年 提交于 2019-12-10 14:59:57
问题 I've written my entire Angular app managing to avoid the use of $scope, using the "controller as" syntax instead, to help ease the transition to Angular 2.0 and because I believe this is the more current practice. But I can't figure out how to avoid using $scope with ui-grid's gridApi.edit.on.afterCellEdit event, which is documented as follows: gridApi.edit.on.afterCellEdit(scope,function(rowEntity, colDef){}) Parameters rowEntity – {object} – the options.data element that was edited colDef –

Keep selection after ui-grid data refresh

ε祈祈猫儿з 提交于 2019-12-10 14:32:39
问题 I am using ui-grid in my web application. Everything is working fine, the issue is when I refresh the grid data the selection gets removed. In the Fiddle when I select a row and then hit the refresh the button the ui-grid selection gets removed. JSFiddle: http://jsfiddle.net/mdawood1991/xyuotpe8/6/ HTML: <div ng-controller="MyCtrl as controller"> <button ng-click="controller.refreshData()" type="button"> Refresh </button> <div ui-grid="controller.assetListGrid" ui-grid-selection></div> </div>

Remove export to pdf option in Angular ui-grid

懵懂的女人 提交于 2019-12-10 14:27:42
问题 Is there a way to remove the option to export to pdf from the ui-grid dropdown menu? I want to keep the ability to export to csv, but cannot figure out how to remove the pdf feature without removing all export capability. I edited this plunker from the docs to remove all of the scripts and JavaScript that are relevant to the pdf exporter. This effectively disables the functionality, but the option to export to a pdf is still available from the menu. app.controller('MainCtrl', ['$scope', '

UI-GRID header - Change Color And Text

喜欢而已 提交于 2019-12-10 14:23:54
问题 I want to change the color and text of the angular ui-grid header. I want the background of the header to be black and the text to be white. I don't want gradient or shading. I just want it black. What CSS do I need to add? 回答1: This is pretty simple. Just add a headerCellClass for each column with your css. $scope.gridOptions = { enableSorting: true, columnDefs: [ { field: 'name', headerCellClass: 'white' }, { field: 'company',headerCellClass:'white'} ], onRegisterApi: function( gridApi ) {

UI-Grid : Error “Multiple definitions of a property not allowed in strict mode [object Object]” [ IE- Only ]

让人想犯罪 __ 提交于 2019-12-10 13:12:25
问题 While loading Ui-Grid In IE throwing error messages - [true] [SYSERR] Multiple definitions of a property not allowed in strict mode [object Object] Issue is only in IE, Not throwing any errors in FireFox & Chrome. Tested on IE Version-11. Thanks in Advance. 回答1: As the error state, you are using somewhere an object that has more than one property with the same name . Something like : var obj= { property1: 0, property2: 1, property1: 2 }; Printing the upper object results in : { property1: 2,

Whats the equivalent for ng-grid's “beforeSelectionChange” in ui-grid?

六月ゝ 毕业季﹏ 提交于 2019-12-10 12:55:33
问题 In ng-grid , I used to use beforeSelectionChange in the following way: When the user selects a row, an ajax call is performed. While the ajax call is happenning I set $scope.doingAjaxCall = true , and to prevent the user from changing the selection, I had this in the grid definition: beforeSelectionChange: function () { return !($scope.doingAjaxCall); }, which locks/freezes the selection if the ajax call is happenning. Now, in ui-grid (aka ng-grid 3), I don't know whats the equivalent for

angular ui-grid custom header html

折月煮酒 提交于 2019-12-10 12:34:01
问题 I'm trying to add a glyphicon glyphicon-thlist (that I can click and call a controller function) to the left hand side of the default header. I took the default header and trying to manipulate it to do this. The default header is located: https://raw.githubusercontent.com/angular-ui/ui-grid/master/src/templates/ui-grid/uiGridHeaderCell.html I changed it to the below, but what happens is I end up with 2 rows. The top row has my icon on the left, on the right is the sorting dropdown and then

What is Default Header Cell Template of UI-GRID?

。_饼干妹妹 提交于 2019-12-10 03:54:11
问题 The ng-grid documentation contains default Header Cell Templates (as well as other default templates). What is the default header cell template for ui-grid? 回答1: Per the githubs https://github.com/angular-ui/ui-grid/tree/master/packages/core/src/templates/ui-grid The current default header cell template is <div ng-class="{ 'sortable': sortable }"> <!-- <div class="ui-grid-vertical-bar"> </div> --> <div class="ui-grid-cell-contents" col-index="renderIndex" title="TOOLTIP"> <span>{{ col

How to access the sorted rows in an Angular UI Grid?

心不动则不痛 提交于 2019-12-10 02:16:07
问题 I am using the Angular UI Grid to display some data. Sorting is enabled and initialized as well as selecting a single row: vm.gridOptions = { enableSorting: true, enableRowSelection: true, multiSelect: false, noUnselect: true, columnDefs: [ { name: '#', field: 'ID' }, { name: 'Name', field: 'CODE', sort: { direction: 'asc', priority: 1 } }, { name: 'Comment', field: 'DESCR' }, ], data: [] }; I am able to select a row and the rows are sorted by the "Name" column in ascending order as