ag-grid-ng2

Ag grid Align Master Detail grid columns

≯℡__Kan透↙ 提交于 2019-12-24 07:27:19
问题 I am following the Ag-Grid master detail docs, and trying to get both the master and detail grid columns to align and stay in sync as mentioned in the aligned grid docs. But it appears not to work with master detail layout. I went debugging Ag-grid alignedGridService and found that the passed grid config is supposed to have a grid API reference which is used to bind grid events across both grids, // iterate through the aligned grids, and pass each aligned grid service to the callback const

How to include ag-grid styles for Angular 5?

烂漫一生 提交于 2019-12-23 22:10:13
问题 I'm using Angular 5 with ag-grid 17.x and am just trying to do a simple, "hello world"-type example, but having trouble getting the grid to display appropriately. I have the following HTML in my template: <div style="width: 800px; height: 500px" class="ag-theme-balham"> <ag-grid-angular [rowData]="rowData" [columnDefs]="columnDefs"> </ag-grid-angular> </div> ...and I don't get any errors, but instead of a grid, it's just rendered as one jumbled column of text. Anyway, I noticed in dev tools

Can you specify a different customCellRenderer to different rows in ag-grid Angular

谁说胖子不能爱 提交于 2019-12-13 04:09:50
问题 I have built this simple grid: The user chooses an option from List 1 in ParenColumn. Depending on which option he chose, different lists will be displayed in column 2. For example, if he chooses option3 then list 3 will be displayed in the second column in the corresponding row. The problem is: Since the customCellRenderer in column two is applied to all the rows then The same list will be shown in All the rows as you see in the picture. My question is: Is it possible to "give" each row its

ag-grid Angular “colDef.cellRendererFramework.component is deprecated”

◇◆丶佛笑我妖孽 提交于 2019-12-13 03:13:40
问题 Since previous version of ag-grid we could pass a Component as a dependency into our cellRendererFramework like this: { headerName: "Clickable Component", field: "name", cellRendererFramework: { component: ClickableParentComponent, dependencies: [ClickableComponent] }, width: 200 } this is an example taken from this ag-grid blog. Unfortunatelly version 9 gives me a deprecated warning about this: colDef.cellRendererFramework.component is deprecated - please refer to https://ag-grid.com/best

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

Custom filter: can I have custom buttons for filter?

随声附和 提交于 2019-12-11 15:27:17
问题 I am trying to have my own custom filter on ag-grid angular. Apart from Apply button, I also want to have other buttons for the filter. i.e. if I can explain this in some sort of UI, |--Custom Filter-------------------. | Filter Text: _____________ | | Apply | Clear | Clear All | |_______________________| By using default filter component of ag-grid , I know that I can have two buttons I need if I provide filterParams in ColDef . filterParams: { applyButton: true, clearButton: true } But what

Event listener works outside of the grid but doesn't work inside a cell in ag-grid

陌路散爱 提交于 2019-12-11 14:55:10
问题 I have been struggling with making a simple listener work inside of a cell in ag-grid. What's bothering me is that it works perfectly if I place it in the html file. In app.component.html: <select class="form-control" (change)=" RefreshRisqueBrutColumn();" > <br> <option>1- Très improbable</option> <option>2- Peu probable</option> <option>3- Possible</option> <option>4- Probable</option> </select> In app.component.ts, I have the listener definition: public RefreshRisqueBrutColumn() { const

Scoping issues while using context menu

怎甘沉沦 提交于 2019-12-11 07:13:54
问题 I'm following the docs here to add a context menu item to my grid. The issue is that from the scope of getContextMenuItems (in the example), I'm unable to access any other methods or variables in my component. Is this possible? Example below: private varIWantToAccess: boolean = false; function getContextMenuItems(params) { var result = [ { // custom item name: 'Alert ' + params.value, action: function () { window.alert('Alerting about ' + params.value); this.varIWantToAccess = true; // Builds

Issues Customizing the Ag-Grid Themes

那年仲夏 提交于 2019-12-10 15:27:14
问题 How do I go about customizing the Ag-Grid themes (eg. ag-theme-material.css) in an existing Angular App? The documentation they have provided is lacking, as it doesn't explain how to perform these changes/configurations. Any help would greatly be appreciated. 回答1: Add ag-grid-overrides.scss file and put the saas variable you want to modify for the ag-grid theme. Full list of sass variables available can be found in this link - https://github.com/ag-grid/ag-grid/tree/master/src/styles. Import