select rows with checkbox: problem!
select rows with checkbox: problem!
Hi all,
I am very pleased DataTables and is now trying to actively explore this.
At this stage I have a problem: I may not know just js synax, and therefore can not properly implement what I need.
Here is my code:
[code] jQuery('#table input').click( function() {
if ( jQuery(this).hasClass('gradeX') )
jQuery(this).removeClass('gradeX');
else
jQuery(this).addClass('gradeX');
} );
[/code]
I need to when selected checkbox, selects the whole line (tr) containing this checkbox.
Ie, instead of 'this' one must insert a js selector, which will indicate to the parent object.
I'm trying to insert the ':parent:parent', but this leads to the selection of all rows that contain checkboxes.
How do I specify a script to provide a current row?
I am very pleased DataTables and is now trying to actively explore this.
At this stage I have a problem: I may not know just js synax, and therefore can not properly implement what I need.
Here is my code:
[code] jQuery('#table input').click( function() {
if ( jQuery(this).hasClass('gradeX') )
jQuery(this).removeClass('gradeX');
else
jQuery(this).addClass('gradeX');
} );
[/code]
I need to when selected checkbox, selects the whole line (tr) containing this checkbox.
Ie, instead of 'this' one must insert a js selector, which will indicate to the parent object.
I'm trying to insert the ':parent:parent', but this leads to the selection of all rows that contain checkboxes.
How do I specify a script to provide a current row?
This discussion has been closed.
Replies
this.parentNode.parentNode
/closed