ag-grid

ag-grid gridApi.setFilterModel() model with multiple conditions [angular6]

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-24 08:58:40
问题 I want to filter my table based on a set of rules. I found that this was possible to do via filtermodels and conditions. I tried to stack conditions but that doesn't seem to work. e.g. This works Filter = { columnName: { condition1 : { type: 'contains', filter: 'searchstring1', }, operator: 'AND', condition2 : { type: 'contains', filter: 'searchstring2', }, }, }; This does not work. Filter = { columnName: { condition1 : { condition1 : { type: 'contains', filter: 'searchstring1', }, operator:

Is there a high-level Ag-Grid event to listen to any change to column state?

醉酒当歌 提交于 2019-12-24 08:03:16
问题 I use Ag-Grid together with Angular and I would like to listen to any event that modify column state. As of now, I have to list all events: (columnVisible)=onCol($event) (columnMoved)=onCol($event) etc. Is there a generic or higher-level event I could rely on in order to listen to any change to column state? 回答1: There's addGlobalListener , listed here. There's an example: https://www.ag-grid.com/javascript-grid-column-definitions/#column-api-example Here's the relevant code from the Angular

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

AG-grid Decimal Precision based on the values of the data

柔情痞子 提交于 2019-12-24 04:38:05
问题 I have some decimal value columns in a grid where I want to have a variable precision based on the values of the decimal. Specifically, decimal places of precision should be 0 if the value is > 9.5, precision should be 1 if the number is between 0.5 and 9.5 & 2 otherwise. Currently, I am defining the precision in the column definitions like this: "columns": [ { "name": "exposure", "type": "DECIMAL", "title": "Exposure", "precision": 2, "width": 77 }, { "name": "total_risk", "type": "DECIMAL",

ag-grid set the column header to be a checkbox,and do the select all or deselect all column,other than only groups

ⅰ亾dé卋堺 提交于 2019-12-24 01:45:12
问题 when using ag-grid, I want to set the first column header to be a checkbox,and do the select all or deselect all column action on all rows other than only groups. 回答1: In gridOptions: angularCompileHeaders: true Where you are defining your columns, define the first column as such: { field: 'RowSelect', headerName: ' ', checkboxSelection: true, suppressMenu: true, suppressSorting: true, headerCellRenderer: selectAllRenderer }, In that file define the renderer: function selectAllRenderer(params

ag-grid set the column header to be a checkbox,and do the select all or deselect all column,other than only groups

时光总嘲笑我的痴心妄想 提交于 2019-12-24 01:45:01
问题 when using ag-grid, I want to set the first column header to be a checkbox,and do the select all or deselect all column action on all rows other than only groups. 回答1: In gridOptions: angularCompileHeaders: true Where you are defining your columns, define the first column as such: { field: 'RowSelect', headerName: ' ', checkboxSelection: true, suppressMenu: true, suppressSorting: true, headerCellRenderer: selectAllRenderer }, In that file define the renderer: function selectAllRenderer(params

AG-Grid dynamic column header text

左心房为你撑大大i 提交于 2019-12-23 23:51:59
问题 This seems like it'd be simple but it's proving otherwise. For some reason headerName is converted to a string and so it can't be a function. I've also tried various renderer and headerComponent functions but like I said, I just want to return a dynamic string, not override everything and have to re-implement it (such as with the case of a custom header component). // I'm trying everything at this point, nothing renders out.. getHeaderCellTemplate: () => 'test 2', headerCellTemplate: () => {

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

How To translate “No Rows To Show” message in ag-grid?

爷,独闯天下 提交于 2019-12-23 09:38:49
问题 How to translate "No Rows To Show" message in ag-grid based on the user selected language? I tired something like this. gridOptions: GridOptions = <GridOptions> { rowSelection: 'single', enableColResize: true, enableSorting: true, enableFilter: true, suppressCellSelection: true, overlayNoRowsTemplate: '<span style="padding: 10px; border: 2px solid #444; background: lightgoldenrodyellow;">'+.......+'</span>' }; I need to add some thing at that .... place. 回答1: According to the

How to filter the data using checkbox in aggrid table using reactjs

一笑奈何 提交于 2019-12-23 04:49:07
问题 How to filter the data while checking multiple checkbox in grid table? when I am selecting checkbox in the filter it should filter the data based on checkbox value. But am not able to filter the data when am checking multiple checkbox. Initially I tried for single checkbox filter it works fine. ScaleChoiceFilter(value) { console.log(value); let newValue = this.state.text; newValue.push(value); this.setState( { text: newValue }, () => { this.props.filterChangedCallback(); } ); } doesFilterPass