Select All Row
Select All Row
argentario84
Posts: 3Questions: 0Answers: 0
Hi all,
i have a table with 1000 row.
I put a button named "Select All" near my table, and i want, if button is clicked, change css class to all table rows.
I made this with this instruction, where "table3" is name of my datatables object.
[code]$('td', table3.fnGetNodes()).addClass('row_selected');[/code]
When i click the button, the script does what I expect, after several alert "A script on this page is causing internet explorer to run slowly".
Is there a better way to make what i want?
Thanks and sorry for my poor English!
i have a table with 1000 row.
I put a button named "Select All" near my table, and i want, if button is clicked, change css class to all table rows.
I made this with this instruction, where "table3" is name of my datatables object.
[code]$('td', table3.fnGetNodes()).addClass('row_selected');[/code]
When i click the button, the script does what I expect, after several alert "A script on this page is causing internet explorer to run slowly".
Is there a better way to make what i want?
Thanks and sorry for my poor English!
This discussion has been closed.
Replies
[code]$('#exampleTable tr').addClass('row_selected');[/code]
[code]
table3.$('td').addClass('row_selected');
[/code]
however, do you really want to add the class to the TD cells rather than the TR rows (as AAAlexander suggests)? Adding to the cells is always going to be slow in IE, no matter how you do it.
Allan