View Full Version : [CLOSED] Prevent GridPanel w/ Checkbox Selection Model from firing individual rows checkbox events when hdr checkbox is checked

Oct 24, 2017, 9:57 AM
We have a grid panel with checkbox selection model that display some data with the amount in the last column.
Whenever a checkbox is checked or unchecked, the amounts are summed up and shown in a label. The select and deselect listeners are used for this operation.

However, when the header checkbox in the grid panel is checked or unchecked, the individual rows checkbox listeners are fired which is causing the page unresponsive for some time.

Is there any way to avoid the individual row listeners from firing when the header checkbox is checked and also when the page is changed using the paging toolbar.

Oct 31, 2017, 4:16 PM
Hello @iansrilley!

Sorry for the delayed reply! Without a test case I guess you don't expect from us any code, so here's what I suggest:

You can bind an event to the header checkbox so that, while it is propagating its 'check' thru the checkboxes in the rows, then they can know it is coming from the header, so then you just skip the function code the event handler you gave to the individual rows don't run.

So every time you click the header, it will set its state, then switch the rows as it usually does, and in the end of its own event, it undoes the state, so that next clicks to the individual checkboxes get their events handled as usual.

I hope this helps!

Dec 01, 2017, 6:04 PM
Hello @iansriley!

Been a while since we replied you and still no feedback. Do you still need assistance with this? We may mark this as closed in 7+ days from now if you don't reply, but you'll still be able to post a follow-up here whenever you want.