简体   繁体   中英

Jquery Datatable Sort Click Event in Table Header Not in Column Title Text

I have this table which I implement the Jquery-DataTables

and in that I have a Select All function that works well;

<thead>
  <tr>
    <th>
      <label>
        <input type="checkbox" > All
      </label>
    </th>
  </tr>
</thead>

the problem is when I clicked the checkbox the sort event of table is also being performed. what I want is, when I click on the Text "All" or the Checkbox the sort event will not perform, instead, it will only perform as usual if the table header(outside the Text or Checkbox) and the Sort-Icon is clicked.

any idea how to do it?

I have solved this issue by running this script (from this ) after initialization of Jquery-Datable to my table;

$('input').click(function (event) {
    event.stopPropagation();
});

hope it will help someone someday.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM