Sorting Form Not Working - Debug code: ecinan
Sorting Form Not Working - Debug code: ecinan
RemyHouard
Posts: 7Questions: 0Answers: 0
Hello,
I downloaded DataTables recently and i'm having some issues with sorting form fields. In this case a checkbox.
There is an example here with 2 forms one working (without input sorting) and another not working:
http://sistema.chezremy.com.br/?site=mm&do=playground&udo=data-tables
Debug code: ecinan
Thak you for you time and Great Job!
I downloaded DataTables recently and i'm having some issues with sorting form fields. In this case a checkbox.
There is an example here with 2 forms one working (without input sorting) and another not working:
http://sistema.chezremy.com.br/?site=mm&do=playground&udo=data-tables
Debug code: ecinan
Thak you for you time and Great Job!
This discussion has been closed.
Replies
I got it working halfway. New Code: uqehik
Same link.
Now the table loads and I get no error on the console.
However the sorting is broken.
Once again thank you.
Allan
I apreciate the swift reply.
I have used the code in your link example. In fact my second table is pretty much a copy-paste of it.
DataTables loads and tries to sort the checkbox. It does work halfway, the rows are re-ordered but the sort is broken.
I have removed the first table of my example page. I see now that it was redundant.
New code: ugenug
Remy
[code]
$.fn.dataTableExt.afnSortData['dom-checkbox'] = function ( oSettings, iColumn )
{
return $.map( oSettings.oApi._fnGetTrNodes(oSettings), function (tr, i) {
return $('td:eq('+iColumn+') input', tr).prop('checked') ? '1' : '0';
} );
}
[/code]
jQuery 1.9 changed how nodes which are not in the document are ordered with broke the old method. The up-to-date methods are found on the page I linked to.
Allan
Thank you!
Is there a browser compatibility issue I should know about?