link in of table header should not sort the table

link in of table header should not sort the table

kasimn84kasimn84 Posts: 4Questions: 0Answers: 0
edited April 2014 in DataTables
I have a check box in tag of table header and i have sort option enabled for the data table. When I click the check box the sorting of the table happens, I want the sorting to occur when i click on the header of the table but i do not want sorting to occur when i click on the checkbox which is present in the header of the table.

This should work in IE8, firefox, chrome and Safari.

I tried adding event.stopPropogation but it works only in chrome and safari.

Replies

  • allanallan Posts: 63,599Questions: 1Answers: 10,486 Site admin
    Add a call to `stopPropagation` to stop the event bubbling up the document. See:

    https://developer.mozilla.org/en-US/docs/Web/API/event.stopPropagation
    http://api.jquery.com/event.stoppropagation/

    Allan
  • kasimn84kasimn84 Posts: 4Questions: 0Answers: 0
    Thanks Allan, I have already tried it. but it is not work consistently across IE8 and above , firefox , chrome and safari too.
  • kasimn84kasimn84 Posts: 4Questions: 0Answers: 0
    I have a check box in tag of table header and i have sort option enabled for the data table. When I click the check box the sorting of the table happens, I want the sorting to occur when i click on the header of the table but i do not want sorting to occur when i click on the checkbox which is present in the header of the table.

    This should work in IE8, firefox, chrome and Safari.

    I tried adding event.stopPropogation but it works only in chrome and safari.
  • kasimn84kasimn84 Posts: 4Questions: 0Answers: 0
    edited April 2014
    The issue has been resolved. thanks for your support. i had to call the event.stopPropogation() at higher level.
This discussion has been closed.