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

  1. #1

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

    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.
    Last edited by fabricio.murta; Feb 23, 2018 at 5:03 PM. Reason: no feedback from the user in 7+ days
  2. #2
    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!
    Fabrício Murta
    Developer & Support Expert
  3. #3
    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.
    Fabrício Murta
    Developer & Support Expert

Similar Threads

  1. Replies: 4
    Last Post: Apr 30, 2015, 4:47 PM
  2. Replies: 1
    Last Post: Apr 30, 2014, 8:03 PM
  3. Replies: 10
    Last Post: Apr 19, 2013, 3:16 PM
  4. Replies: 11
    Last Post: Mar 14, 2012, 10:12 AM
  5. Replies: 4
    Last Post: Oct 06, 2010, 9:08 AM

Posting Permissions