ag-grid

In Ag-Grid, how to make a floating row not editable when column is defined as editable?

耗尽温柔 提交于 2019-12-12 13:45:32
问题 In AG-Grid, How to make a floating row not editable when a column is defined as editable? Is it possible to use floatingCellRenderer to prevent cell editing for the floating row cell? floatingCellRenderer: function(params) { if (params.node.floating) { do_something_here_to_prevent_this_cell_editing; } } I am using the default cell editors for text/select on the grid. 回答1: jsfiddle all you need to do is make a function that checks whether or not a row is floating: function notFloating (params)

Angular 6 - Add new row in AG Grid

随声附和 提交于 2019-12-12 12:23:58
问题 I want to add a new element in AG Grid. I have a following model: export class PersonModel { cars: CarModel[]; } The AG Grid has as rowData the array Cars of my model. But this array is not Observable. Now I want to add a new car when I click a button: <button type="button" (click)="onClickCreateCar()"> And in my viewmodel: onClickCreateCar() { var emptyCar = new CarModel(); this.person.cars.push(emptyCar); } I can not see the new row in the grid because the array Cars is not observable. It

How can I use ag-grid with Observable in angular2?

拜拜、爱过 提交于 2019-12-12 10:43:42
问题 I have done lots of research on Internet but still cannot glue these together. I have an angular2 application, with Observable data source from HTTP, and would like to use ag-grid. The problem is I only got a loading screen instead of the data. I have investigated with Fiddler, the data is loaded successfully and correctly in JSON. Here is my code: order.service.ts import { Injectable } from '@angular/core'; import { Headers, Http, Response } from '@angular/http'; import { Observable } from

Ag-Grid: Number Formatting eg:123456.78 to 123,457

倖福魔咒の 提交于 2019-12-12 08:22:56
问题 I have huge sets of numeric data. this needs to be rendered as comma separated value. For Ex. 123456.78 to be rendered as 123,457 using Ag-Grid. Kindly help me on achieving this. 回答1: As per the cell rendering flow documentation (here), you can use the colDef.valueFormatter, like this: var columnDefs = [ {headerName: "Number", field: "number"}, {headerName: "Formatted", field: "number", valueFormatter: currencyFormatter} ]; function currencyFormatter(params) { return '£' + formatNumber(params

Ag-grid RowStyle with selected row

亡梦爱人 提交于 2019-12-12 05:37:34
问题 I am using ag-grid 5.1.2 I've configured a getRowStyle function to set the background-color for certain items. I've noticed that has overridden the 'selected row' color now, so when a row is selected the background will not change to indicate as such. What is the correct way to still let highlighted row color work with the custom getRowStyle. Here is the typescript for the rowStyle function: self.customRowStyle = function (params: AgParams) { if (!params.data.isShaded) { return { 'background

ag-Grid, try to make Tree Demo work using own data

北城余情 提交于 2019-12-12 02:28:44
问题 I like the ag-Grid because it's less buggy, fast and works with many frameworks. So I tried the Tree Data, no need to tell the link between parents and children, simply lay down the data in structure, specify some options, Bingo! But, when I plug in my API, it tells me "TypeError: rowData is undefined" from inside of ag-grid.js even though Watch clearly shows it has the array. There are some answered Question here regarding customization with internal api. Mine is not. I then use the official

ag-grid API Undefined in Angular 2

Deadly 提交于 2019-12-12 02:17:59
问题 I am using the ag-grid API in an Angular 2 app, inside the ngOnInit method. In the onGridReady event like mentioned in this post, the API is accessible and things work fine. However, I need to call the API in one of the following methods as well: onRowDataChanged onNewColumnsLoaded onModelUpdated This is not working because the API is undefined. In addition, for some reason I can also call the API in the onCellDoubleClicked and onCellClicked events. This seem to be a bug. Does anyone know

this.gridApi.refreshInfiniteCache() is not clearing selectedRows

纵然是瞬间 提交于 2019-12-11 22:54:32
问题 I am using Infinite Row Model and when i deleted the selected row from Grid then i am calling refreshing cache so lets say i deleted the selected id = 1 but after refreshInfiniteCache() ; new row comes from DB via getRows() its id = 2 and that selected row does not get un-select auto and if i am clicking on delete button again then I am getting two rows in selectedData. Why is that? from this.gridApi.getSelectedRows() and getSelectedNodes() i am getting two rows previous row id = 1 and next

Use browser level scroll instead of Grid Level (table level) scroll in ag-grid

我与影子孤独终老i 提交于 2019-12-11 20:39:36
问题 I am using ag-grid to show data but while using it I have 2 scroll bars one at grid-level and another at browser level I want to use browser level scroll bar for ag-grid. I didn't find any clue in the ag-grid documentation to implement this. 回答1: You can use domLayout property for this. Refer to this example how they have set domLayout = "autoHeight" and how it is being used: ag-grid Auto-Height domLayout: Set to 'normal', 'autoHeight' or 'print' to switch between layout options. The default

AG-Grid Enterprise: How to replace Column Menu by community filter

核能气质少年 提交于 2019-12-11 18:41:47
问题 I'm trying the entreprise version of Ag-Grid, but when using this version I can not have the standard "column filter". It only have a "Columns panels" with a filtering but, this one is more difficult to use. Is there any way to have the community version of column filter, when using the ag-grid entreprise version (that I need for some other functionnality). Maybe by specifying some menuTabs options... but the doc doesn't help on what is the options available for these menu. Here is an example