angular-ui-grid

Angular ui grid - specific class for unselectable row

笑着哭i 提交于 2019-12-08 03:30:07
问题 I use angular ui-grid to display my data. I enabled the option to select row in gridOptions: enableRowSelection: true, But for specific rows I disable the selection by this code: $scope.mygrid.isRowSelectable = function (row) { if (row.entity.id == 2) { return false; } else { return true; } }; This is work, I cant select row with id =2, But I want to add class for this row to notify that it is unselectable. Any idea? 回答1: To Highlight the actual row: You can write your own rowTemplate and

angular ui-grid auto height if rows have non-constant height

那年仲夏 提交于 2019-12-07 22:58:32
问题 I'm trying to make angular ui-grid automatically resize the height so that all rows are shown without the need of its scrollbar, but without wasting space if there are only a couple rows in the grid. Someone has asked a similar question (Angular ui-grid dynamically calculate height of the grid), but the question presupposes that the row heights are constant. If the row heights are different (for example, because you have word-wrap enabled), then the accepted solution to the problem (https:/

angular js ui-grid double click on row not working

∥☆過路亽.° 提交于 2019-12-07 22:32:29
问题 I want to call a function myFunc on doubleclick of ui-grid row. for that I have used <ng-dblclick="grid.appScope.myFunc()"> but it is not being called and showing no error. here is the calling part of html : <div ui-grid="gridOptions" ui-grid-selection class="gridStyle" ng-dblclick="grid.appScope.myFunc()"> </div> and here is the js script: var myData = [{name: "Moroni", age: 50}, {name: "Tiancum", age: 43}, {name: "Jacob", age: 27}, {name: "Nephi", age: 29}, {name: "Enos", age: 34}]; var app

external-scopes no longer works in ui-grid

耗尽温柔 提交于 2019-12-07 14:01:18
问题 I am upgrading the ui-grid from v3.0.0-RC.18 to v3.0.0-rc.20-76029e7 and suddenly the external-scopes attribute stops working. What is the alternative to it? 回答1: externalScopes was removed in RC 19. You can read the notes here: https://github.com/angular-ui/ng-grid/blob/master/CHANGELOG.md#breaking-changes Instead, you can use appScope , which has been docoumented here: http://ui-grid.info/docs/#/tutorial/305_appScope The grid gets a property called appScope added to it that simply

ng-grid/ui-grid celltemplate on click causes row to be selected.

别来无恙 提交于 2019-12-07 12:23:30
问题 When I use celltemplate for ahref link, once the link is clicked the row highlights because i have RowSelection enabled...but i dont want the row to highlight when the link is clicked..only if the row is clicked anywhere but the link. Also in my below example picture, how do I remove the little arrow so no Menuitems can be displayed for that column? Code: $scope.gridOptions = { showFooter: true, enableFiltering: true, enableRowSelection: true, enableRowHeaderSelection: false, enableSelectAll:

Angular ui-grid tables, client side pagination and scrolling

青春壹個敷衍的年華 提交于 2019-12-07 09:47:48
问题 I'm trying to port a small project from jquery to angularjs. I was using DataTables to plot diagnostic data received from my virtual machines, this is an example: DataTables makes it easy to paginate the data, this has the benefit of not capturing the mouse scroll while navigating, which is the best solution when your pages contain a lot of tables. I'm now trying to do the same thing using ui-grid from angular-ui but the pagination options that were present in ng-grid are not present anymore

Angular ui grid double click event setup

随声附和 提交于 2019-12-07 07:21:18
问题 So I'm trying to get my Angular UI Grid to register a double click event on an entire row to open up a modal. I can start with a toastr toast and go from there though. This is the closest I've come based on various demos and examples online, but I just can't seem to get it to work. Controller: $scope.gridHandlers = { onDblClick: function(rowItem){ toastr.success(rowItem, 'Row Item:') } } $scope.gridOptions = { onRegisterApi : function(gridApi){ $scope.gridApi = gridApi }, data: $scope

UI-GRID - Dynamic Row Height - Alternatives

强颜欢笑 提交于 2019-12-07 06:59:19
问题 I tried to get a cell to expand it's height dynamically. Is there a way to adjust the height of a row(GridRow) after it is rendered? If not, then I will try to use an expandable grid or tree in a grid. Is it possible to display an expandable grid off a specific cell/column? Currently I see all expandable grids/tree grids that take up the entire row below the parent. Thanks 回答1: You can see an answer to the same question here: https://github.com/angular-ui/ng-grid/issues/3239#issuecomment

External ui-grid-menu-button

倾然丶 夕夏残阳落幕 提交于 2019-12-07 03:23:59
问题 I want to separate ui-grid-menu-button from the ui-grid-menu . So my select column buttons will be in another place. I tried to put a watch on the toggleMenu function and in a click on my button it should trigger and should open the list. I also tried to use the broadcast option but it's not working. What is the best way to do it? 回答1: I answered the same question here. Thanks @pilar1347 for the tip, my solution is a bit less hacky. 来源: https://stackoverflow.com/questions/26590471/external-ui

Angular ui-grid external export buttons

佐手、 提交于 2019-12-07 01:40:48
问题 I am new working with the Angular UI-GRID and I need to create external buttons for the exporting features like PDF export and CSV Export similar to this image. Do you have any idea how can I do it ? Also I need a Print button but I don't see it in the documentation. Is there a Print behavior for this grid ? Thank you, Ernesto 回答1: Taking a look at the ui-grid.exporter source code (this will specifically address pdf export, which starts at ~line 972, but you can apply it to the csv use case