How to use groupInnerCellRenderer in AgGrid React - reactjs

The AgGrid documentation for Grouping Footers, mentions there is a way to customize the rendering of the grouped row using groupInnerCellRenderer, but its not clear if this prop needs to be added to the gridOptions or to cellRendererParams for agGroupCellRenderer, see the excerpt below:
When showing the groups in one column, the aggregation data is displayed in the group header when collapsed and only in the footer when expanded (ie it moves from the header to the footer). To have different rendering, provide a custom groupInnerCellRenderer, where the renderer can check if it's a header or footer.
I was wondering if someone could post an example of agGrid that uses groupInnerCellRenderer.

groupInnerCellRenderer should basically be added to cellRendererParams with a custom cell renderer component something like this -
{
headerName: 'City',
field: 'city',
minWidth: 240,
showRowGroup: true,
cellRenderer: 'agGroupCellRenderer',
cellRendererParams: {
suppressCount: true,
checkbox: true,
innerRenderer: 'simpleCellRenderer',
suppressDoubleClickExpand: true,
suppressEnterExpand: true,
},
},
The group cellRenderer will take care of all the expand / collapse, selection etc, but the with simpleCellRenderer you can customize how the cell displays for grouped row.
There is neat example of this in the docs - https://www.ag-grid.com/javascript-grid-provided-renderer-group/#example-group-renderer

Related

Ext JS gridpanel's word wrapping doesn't work well with renderer

I'm using wordWrap config for grid columns and version of EXT JS I'm using is 6.5.3:
{
dataIndex: "header",
menuDisabled: true,
sortable: false,
cellWrap: true,
renderer: myRenderer
}
The problem with it is that the grid renderer seems to affect cells individually so the whole grid is not consistently rendered when there are word-wrapped cells and regular cells at the same time:
Inconsistently Rendered Grid
What I want to achieve is like:
Consistenly Rendered Grid
Does anyone have any solution to fix it?
I'd appreciate some help : )
I have no idea how to handle it.
You can add css to grid cells common class
text-overflow: ellipsis;

AngularJs : style a column in Ag-grid

I want to style a column in ag-grid, using AngularJs (I want it to look like hyperlinks, maybe even with visited/unvisited colo(u)rs). The particular style is not important; I just want to know how to style a column. Static styling is fine; I don't need dynamic styling.
How do I do it?
columnDefs: [{ headerName: "Candidate",
field: "candidate_name",
sortable: true,
cellStyle: function(params) {return {color: 'red'}}},
I am unsure how to do it without the callback, but I can live with this.

checkcolumn grid cell border conditional change in accordance to disable-enable state in sencha 6.0.2

I have a grid with two checkcolumns (apart from the rest columns) and I want to make conditional change of cell (adding specific CSS: making thicker borders of this cell if checkcolumn is enabled and default look if it is disabled) in accordance to disable / enable state.
Unfortunately with using Renderer function I end up with strange outcome (displayed object text or true/false values) because of override native Renderer of checkcolumn I presume. Overwriting checkcolumn renderer is also bad practice which I'm not allowed to do.
I've also tried to use listeners like beforeactivate, beforeDisable etc but they seems not being called whenever state of cell change (disabled <> enabled). I thing that it is possible that its because of using specific bind property as seen bellow.
Is there any method to do it clear (without to much of code repetition and without overriding and adding new method to checkcolumn renderer)??
here is code for one of two checkcolumns in my grid:
{
localized: {
text:
'details.tabview.coordination.icccoordination.changepositions.main.view.ebv'
},
dataIndex: 'ebv',
width: 50,
bind: {
disabled: '{!changeContextEditMode.active}'
},
sortable: true,
filter: true,
xtype: 'checkcolumn',
listeners: {
beforecheckchange: 'checkIfCheckChangePossible'
}
}
I will appreciate any help

How to enable SingleClickEdit in ag-grid

I am using ag-grid with angularJS. I need to enable the edit options in the table by doing a single click. Now its happening with double click. Can any one please tell me how to do that?
No worries. I added
singleClickEdit: true
in the place where i define the coldefs and rowdata stuffs.
If adding singleClickEdit: true doesn't allow you to edit,
then in addition make sure the column which you are trying to edit has
editable: true
or use defaultColDef and set to your grid:
defaultColDef contains the properties that is inherited by all columns.
defaultColDef: {
flex: 1,
minWidth: 100,
editable: true,
},

Extjs 4 FiltersFeature vs stateful grid

I have a grid with some columns with filters.
columns defination:
columns:[{
text: "Number",
dataIndex: 'clientreference',
width: 200,
filter: true,
sortable: true
},
here is filter feature defination
features: [{
ftype: 'filters',
encode: true,
local: false
}],
The problem is: When i'm trying to save state of grid, filters are not working: When I adding this code to a grid:
stateful: true,
stateId: 'documentsGrid',
I refresh the page and all works fine, because i dont have state in my cookies.
But when I refresh the page second time - state loads from cookies and filters are not working.
If i remove stateful: true and refresh page, filters are working fine.
Any suggestions?
Also I noticed, that all examples in extjs site are only with filters or with stateful grid, but there is no one example with both.
UPDATED:
The most useful way was making my own method for saving state of elements I need and to restore it.
I think you are specifying features in grid.But you can specify filters in store directly.So try to define filters in store and stateful in grid config options.Hope you may get the solution to come out from this.

Resources