ag-grid: is there a way to trigger event when clear range selection

jason135

When range selection happened, I can listen to rangeSelectionChanged event. Is there any event I can listen to when all selected range are cleared?

sandeep joshi

If I understood correctly by selected range are cleared I am assuming user is randomly clicking on any cell in the grid thus only one cell is getting highligheted and range is cleared. for this there is no separate event so you have to check the CellRange object in that case. below logic you can use inside rangeSelectionChanged event

onRangeSelectionChanged(event) {
...
...

//lets check here if selection is cleared by user or not
var cellRanges = this.gridApi.getCellRanges(); // this gives the cellrange object.
var startRowIndex = cellRanges[0].startRow.rowIndex;
var endRowIndex = cellRanges[0].endRow.rowIndex;
var NumberOfColumns = cellRanges[0].columns.length;

//cellRange.length shows how many different ranges user has selected in Grid

if(startRowIndex === endRowIndex && NumberOfColumns ===1 && cellRanges.length<2)
{
//do your processing here 
}

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to disable selection of cells in ag-grid?

Trigger event when Bokeh DataTable Selection

Trigger event when row is selected in a Kendo UI Grid (Angular 2)

Trigger event when WebBrowser text selection changed

disable checkbox selection in Ag-grid

Angular 2 ag-grid's Clear Filter button clears the textbox without refreshing column when built-in filter is used

Where are "queued" Azure Event Grid Blob trigger event messages stored and how can I clear them?

Is there a way in angular to update the rowData when value changes inside a cellRendererComponent, when using ag-grid-angular

How to trigger an event on selection in Django?

How to reinitialize ag-grid on any event?

Clickable event on ag-grid

focus event is getting called before writeValue() when using custom directive inside ag-Grid cell Editor

How to get the selection order in ag-Grid?

Ag-Grid Prevent onRowClicked event when clicking icon inside cell

Is there any way to get FullCalendar to trigger a function when an Event is due or in progress?

AG Grid : gridReady event not triggered when loading grid in a component via ComponentFactoryResolver

kendoui angular grid selection event

group selection & checkbox in ag-Grid

AG Grid - Best way to access to the GridApi

ag-grid header checkbox selection event

AG-Grid 'columnMoved' event never fires

CellValueChanged event in master detail of ag-grid

Trying to trigger event when a CellEditor in a Grid cell is changed

What is the best way to handle deleting rows in Ag-Grid when using Redux?

Ag-grid: How disable cell click event when enableCellTextSelection is used and text is selected?

how to trigger firstDataRendered on ag-grid in angular?

Is there a way to trigger the event in html

Programmatically trigger button click event on AG grid

Is there way to customise ag grid child count?

TOP Ranking

  1. 1

    Failed to listen on localhost:8000 (reason: Cannot assign requested address)

  2. 2

    Loopback Error: connect ECONNREFUSED 127.0.0.1:3306 (MAMP)

  3. 3

    How to import an asset in swift using Bundle.main.path() in a react-native native module

  4. 4

    pump.io port in URL

  5. 5

    Compiler error CS0246 (type or namespace not found) on using Ninject in ASP.NET vNext

  6. 6

    BigQuery - concatenate ignoring NULL

  7. 7

    ngClass error (Can't bind ngClass since it isn't a known property of div) in Angular 11.0.3

  8. 8

    ggplotly no applicable method for 'plotly_build' applied to an object of class "NULL" if statements

  9. 9

    Spring Boot JPA PostgreSQL Web App - Internal Authentication Error

  10. 10

    How to remove the extra space from right in a webview?

  11. 11

    java.lang.NullPointerException: Cannot read the array length because "<local3>" is null

  12. 12

    Jquery different data trapped from direct mousedown event and simulation via $(this).trigger('mousedown');

  13. 13

    flutter: dropdown item programmatically unselect problem

  14. 14

    How to use merge windows unallocated space into Ubuntu using GParted?

  15. 15

    Change dd-mm-yyyy date format of dataframe date column to yyyy-mm-dd

  16. 16

    Nuget add packages gives access denied errors

  17. 17

    Svchost high CPU from Microsoft.BingWeather app errors

  18. 18

    Can't pre-populate phone number and message body in SMS link on iPhones when SMS app is not running in the background

  19. 19

    12.04.3--- Dconf Editor won't show com>canonical>unity option

  20. 20

    Any way to remove trailing whitespace *FOR EDITED* lines in Eclipse [for Java]?

  21. 21

    maven-jaxb2-plugin cannot generate classes due to two declarations cause a collision in ObjectFactory class

HotTag

Archive