Master_checkbox and onCheck event

In a grid I have a checkbox column and a #master_checkbox.

Fo rthe checkboxes an event handler “onCheck”. Unfordunately if I click master_checkbox the event fires for each checkbox per row and my onCheck event code will be executed for each.

In this special case I need to execute it only once - when master_checkbox has finalized all rom checkbox checks / unchecks.

I try to detach the onCheck event in onHeaderClick but won´t work.

How to solve this.

Please, try to use the onCheckbox event instead of onCheck.
https://docs.dhtmlx.com/api__dhtmlxgrid_oncheckbox_event.html

Hi,

same behaviour. If I check / uncheck a row checkbox both events are fires (this is OK) - I only have one event handler active during this tests.

But if I click the master_checkbox in header the event fires once per row. But I need it only one times if all row checkboxes are check / unchecked.

Unfortunately there is no special event for the master_checkbox clicking.
The only solution is to use the onCheckbox which fires for each checked row.

Solve it manually by adding a single check on top of the grid. If clicked the onCheck event if detached, all row checkboxes are clicked / unclicked, function is called once if foreachrow has finished and event is attached again.