row selection in multiple tables
row selection in multiple tables
bernybaeza
Posts: 1Questions: 0Answers: 0
Hi community. my problem is that i cant use single row selection whit multiple tables, the first table works well but the second one don't loose selection once i select other row.
here is my code
[code]
(document).ready(function () {
var oTable;
[/code]
i make 2 tables whit the follow line in a loop
[code]
$('').attr("id", "tablaTipo" + lista[o].Id).attr("class", "display dataTable");
$('.dataTable tbody tr').click(function (e) {
if ($(this).hasClass('row_selected')) {
$(this).removeClass('row_selected');
}
else {
oTable.$('tr.row_selected').removeClass('row_selected');
$(this).addClass('row_selected');
}
});
oTable = $('.dataTable').dataTable({
"sScrollX": "250px",
"bSort": true,
"bPaginate": false,
"bFilter": false,
"bInfo": false
});
[/code]
the boot tables are working as datatables (shorting.. and stuff)
here is my code
[code]
(document).ready(function () {
var oTable;
[/code]
i make 2 tables whit the follow line in a loop
[code]
$('').attr("id", "tablaTipo" + lista[o].Id).attr("class", "display dataTable");
$('.dataTable tbody tr').click(function (e) {
if ($(this).hasClass('row_selected')) {
$(this).removeClass('row_selected');
}
else {
oTable.$('tr.row_selected').removeClass('row_selected');
$(this).addClass('row_selected');
}
});
oTable = $('.dataTable').dataTable({
"sScrollX": "250px",
"bSort": true,
"bPaginate": false,
"bFilter": false,
"bInfo": false
});
[/code]
the boot tables are working as datatables (shorting.. and stuff)
This discussion has been closed.