Im using Ag-grid to manage my table, but I want the row list to be stored in my group instead of making the row group expandable in 2 clicks, I want to be a single click. If I click on the arrow of the icon, it works, but if I click on the title bar, it will open only 2 clicks.
I already tried to find any information about this in the documentation, but I can not find anything.
Here is an example from the documentation. https://ag-grid.com/javascript-grid-tree/index.php
Image example:
You can listen to events either by line or by cell, and expand nodes accordingly.
, , :
onRowClicked: (params) => { // update the node to be expanded params.node.expanded = true; // tell the grid to redraw based on state of nodes expanded state gridOptions.api.onGroupExpandedOrCollapsed(params.rowIndex) }
- , .
onGroupExpandedOrCollapsed, ...
onGroupExpandedOrCollapsed
, onGroupExpandedOrCollapsed.
onRowClicked(params) { params.node.setExpanded(!params.node.expanded); }
, params.node.setExpanded(true), , .
params.node.setExpanded(true)
In a column definition, you can use a function onCellClicked(params)to tell it to do something when you click a cell. I tried looking for an extension function, but I could only find expandAll()that I do not think you want. So I would just use jQuery or a simple DOM selection to click the extension icon inside this cell.
onCellClicked(params)
expandAll()
this one works
onRowClicked(params) { params.context.setExpand.onExpandClicked(params.rowIndex, params.node.rowHeight); }
Source: https://habr.com/ru/post/1657974/More articles:ASP.Net OData not working with SSL termination in LB - asp.netOverride webapi odata link host - asp.netAngular 2 Service Error. Can't find a reason - angularIs there a data structure in Java that can contain 4 or more values - javasqlalchemy creating VIEW with ORM - pythonHello World does not appear in response to native android - androidDelphi package does not load when I run Delphi - packageHow can I send only one warning using kapacitor if something is not working? - alertFCM pricing and usage limits for commercial application - firebaseC # How to insert an array into a mongodb object - arraysAll Articles