using 'row_selected'
using 'row_selected'
barrykeepence
Posts: 22Questions: 0Answers: 0
I use the 'row_selected' class all the time and generally it works very well. I have tables with single select and multi select behaviour - based on samples from the web site.
I have just realised there is a problem with using 'row_selected' with filtering. Basically if I want to enforce single row selection I use:
[code]
$(my table selector).removeClass('row_selected');
$(this).addClass('row_selected');
[/code]
This works fine except when the table is filtered - if the filtering has removed a previously selected row then the first line of the code will not remove the class.
How can I remove a class from all rows?
I have just realised there is a problem with using 'row_selected' with filtering. Basically if I want to enforce single row selection I use:
[code]
$(my table selector).removeClass('row_selected');
$(this).addClass('row_selected');
[/code]
This works fine except when the table is filtered - if the filtering has removed a previously selected row then the first line of the code will not remove the class.
How can I remove a class from all rows?
This discussion has been closed.
Replies
[code]
table.$('tr.row_selected').removeClass( 'row_selected' );
[/code]
Allan
I never used the $ function much before but know I know it is independent of filtering I will use it more.