html - Disabling sorting on nested DOM Element -
i'm working datatables , have th nested checkbox:
<th class="sku-checkbox-wrapper sorting_desc" rowspan="1" colspan="1" aria-label="select all">select all<br> <input type="checkbox" id="sku_select_all" class="checkbox"></th> currently, th has sorting event handler attached it. de-couple nested checkbox event.
i have th set 'bsortable':'true'. there way 'bsortable' :' false' nested checkbox , keep parent th element sortable?
you need add click event handler checkbox , prevent event propagation parent element.
$("#sku_select_all").on('click', function(e){ e.stoppropagation(); }); see this jsfiddle demonstration.
Comments
Post a Comment