filtering stops working after check all implemented
filtering stops working after check all implemented
[code]
var oTable;
$(document).ready(function() {
$('#check_all').click( function() {
//var oTable = $('#bookmark-project').dataTable();
$('input', oTable.fnGetFilteredNodes()).attr('checked',this.checked);
} );
var oTable = $('#bookmark-project').dataTable( {
//"fnInitComplete" : function () {$('#check_all').click( function() {$('input[name*=\'include\']', oTable.fnGetFilteredNodes()).attr('checked',this.checked);});},
"bPaginate": false,
"sPaginationType": "full_numbers",
"bJQueryUI": true,
"aoColumns": [
{ "sSortDataType": "dom-text" },
{ "sSortDataType": "dom-text" },
{ "sSortDataType": "dom-text" },
{ "sSortDataType": "dom-checkbox" },
{ "sSortDataType": "dom-checkbox"},
{ "sSortDataType": "dom-checkbox"},
]
} );
[/code]
Hello,
With the above code, after the first click on checkall, filtering stops working and always returns "no results". Somehow I suspect it has to do with how the code handles oTable, but I am clueless...
I left the fnInitcomplete solution commented out there as I could not get it to work, although it was suggested here:
http://datatables.net/forums/comments.php?DiscussionID=276
Any tips are appreciated.
Cheers,
G
var oTable;
$(document).ready(function() {
$('#check_all').click( function() {
//var oTable = $('#bookmark-project').dataTable();
$('input', oTable.fnGetFilteredNodes()).attr('checked',this.checked);
} );
var oTable = $('#bookmark-project').dataTable( {
//"fnInitComplete" : function () {$('#check_all').click( function() {$('input[name*=\'include\']', oTable.fnGetFilteredNodes()).attr('checked',this.checked);});},
"bPaginate": false,
"sPaginationType": "full_numbers",
"bJQueryUI": true,
"aoColumns": [
{ "sSortDataType": "dom-text" },
{ "sSortDataType": "dom-text" },
{ "sSortDataType": "dom-text" },
{ "sSortDataType": "dom-checkbox" },
{ "sSortDataType": "dom-checkbox"},
{ "sSortDataType": "dom-checkbox"},
]
} );
[/code]
Hello,
With the above code, after the first click on checkall, filtering stops working and always returns "no results". Somehow I suspect it has to do with how the code handles oTable, but I am clueless...
I left the fnInitcomplete solution commented out there as I could not get it to work, although it was suggested here:
http://datatables.net/forums/comments.php?DiscussionID=276
Any tips are appreciated.
Cheers,
G
This discussion has been closed.
Replies
Allan
a is undefined
[Break on this error] Failed to load source for: .../media/js/jquery.dataTables.min.js?b
The table initializes fine, not sure why all of a sudden it is not finding datatables file. If I remove the search box text, the table loads back fine!
Found the same issue as well http://datatables.net/forums/comments.php?DiscussionID=1908&page=1 although I am not using other libraries. I am using Drupal, and including the library on a page.
This may be related as well:
http://datatables.net/forums/comments.php?DiscussionID=2411
I checked and inserted the checkbox in your demo with the DOM Sort and there it works flawlessly.
Could be a jquery version clash? What version should we be using of jquery?
I had to put an event.stopPropagation in the clickall function, since the checkall button is in thead column, that also has sorting enabled which was clashed :)
Edit: I should have said. I'd always recommend using the latest stable release of jQuery. 1.3 should still work though, and quite probably 1.2.
Allan