Flexgrid checkbox event listener

Posted by: ed on 4 November 2019, 7:59 pm EST

    • Post Options:
    • Link

    Posted 4 November 2019, 7:59 pm EST

    I am trying to add a listener to the a checkbox to fire when the checkbox value changes. I have tried adding listeners to the ‘click’, ‘change’ and ‘click change’ events. When I click on the checkbox none of these events fire. However, when I click within the cell but not on the checkbox, the ‘click’ event fires. What am I doing wrong.

    Thanks, Ed

  • Posted 5 November 2019, 1:17 am EST

    Hi Ed,

    Instead of the click and change event, you will need to handle the mousedown event of the FlexGrid. Please refer to the code snippet:

    grid.hostElement.addEventListener('mousedown', function(e) {
      if(e.target.type === 'checkbox') {
        console.dir('checkbox changed');
      }
    }, false)
    

    Regards,

    Ashwin

  • Posted 5 November 2019, 12:57 pm EST

    Thanks Ashwin

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels