gyrocode / jquery-datatables-checkboxes

Checkboxes is an extension for the jQuery DataTables library that provides universal solution for working with checkboxes in a table.
https://www.gyrocode.com/projects/jquery-datatables-checkboxes/
MIT License
150 stars 61 forks source link

Support for Responsive extension #83

Open rodriguez90 opened 5 years ago

rodriguez90 commented 5 years ago

Hello guys, Im use your jQuery DataTables Checkboxes, and responsive environment, this fail. imagen

imagen

imagen

imagen

mpryvkin commented 5 years ago

Thanks for detailed report. I wrote about possible solution to this problem in jQuery DataTables: Responsive extension and form inputs article.

But it feels like plug-in should have the support built in. I will see what could be done about it.

lestcape commented 5 years ago

Probably a workaround is move the checkbox to the first row to avoid the re-positioning and then probably this will not crash.

JosiaBelow commented 7 months ago

I just ran into this issue in my project. The issue is that the responsive plugin creates a child element, which makes var $cell = $(ctrl).closest('td'); (dataTables.checkboxes.js line 642) not work as intended. To still get the correct value for cellIdx I check the "cell" for the "child" class and get the cellIdx from the closest li instead. var cellIdx = cell.index(); var cellIdx = cell.hasClass('child') ? $(ctrl).closest("li").data('dtr-index') : cell.index();

I only work with the min.js, so here is the fix for that too: d=a.hasClass('child')?k(c).closest("li").data('dtr-index'):n.index().column; instead of d=n.index().column;