select all placement

select all placement

gkgk Posts: 3Questions: 0Answers: 0
edited June 2012 in General
The design for a table calls for a "select All | None" option at the top left where the DataTables sInfo normally goes (and then the page controls to the right of that). I tried to add the html to sInfo like so.
[code]
"oLanguage": {
"sInfo": 'Select All | None'
}
[/code]
But jQuery can't find the elements. My jQuery function never gets called.
[code]
$('a[name="selectAll"]').click(function(){
$('input', oTable.fnGetNodes()).attr('checked','checked');
return false;
});
[/code]
If I just put the select All html in the page somewhere, it works fine. Is jQuery unable to find those elements because they're added after the page is initially loaded? And is there a good way to do what I'm trying to do here, maybe a way to add some html to that top div above the table?

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    I'd perhaps suggest using the selection options in TableTools: http://datatables.net/release-datatables/extras/TableTools/select_multi.html . The position of the buttons can be controlled with sDom and CSS.

    Allan
This discussion has been closed.