jQuery "selectable" and DataTables - how?
jQuery "selectable" and DataTables - how?
datatablesn00b
Posts: 7Questions: 0Answers: 0
Re,
I am using the following code:
[code]
$('#test tbody tr').selectable({
selected: function(event, ui)
{
$(this).addClass('row_selected');
}
});
[/code]
It only selects 1 item. Has anyone done this before? What's the trick? Appears as if the mouse select within the table works on the X axis only.
I am using the following code:
[code]
$('#test tbody tr').selectable({
selected: function(event, ui)
{
$(this).addClass('row_selected');
}
});
[/code]
It only selects 1 item. Has anyone done this before? What's the trick? Appears as if the mouse select within the table works on the X axis only.
This discussion has been closed.
Replies
[code]
$('#test').selectable
({
stop: function(event, ui)
{
$(this).find("tr").each(function()
{
if($(this).hasClass('ui-selected')) $(this).addClass('row_selected');
else $(this).removeClass('row_selected');
})
alert ("You selected :"+$('#test').find('.row_selected').size()+" items.")
}
});
[/code]
This code will select rows using mouse & jQuery UI "selectable". Hope this is useful for someone.
Cheers.
Would be cool to put it in the examples.