Datatable FixedColumns row selection
Datatable FixedColumns row selection
Im trying to do a row selection using the fixed column plugin but I can't manage to get that.
In principle, as the object that returns FixedColumns() doesn't have .fnSettings().aoData i cant access to the properties that control the styles (in all the table model not only in visible layer).
With normal dataTables i'm doing it simply doing in that way:
[code]
$('.dataTable tbody').click(function(event) {
$(tablas[tab].fnSettings().aoData).each(function (){
$(this.nTr).removeClass('row_selected');
$(this.nTr).find("input[type=radio]").removeAttr("checked");
});
$(event.target.parentNode).addClass('row_selected');
});
[/code]
That doesnt work with fixedColumns!.
Then im trying to access to the old datatable model generated before the FixedColumns() call but I can only access to the right part of the table (yes, these with the scroll wrapper).
Any help please?
Thanks a lot
In principle, as the object that returns FixedColumns() doesn't have .fnSettings().aoData i cant access to the properties that control the styles (in all the table model not only in visible layer).
With normal dataTables i'm doing it simply doing in that way:
[code]
$('.dataTable tbody').click(function(event) {
$(tablas[tab].fnSettings().aoData).each(function (){
$(this.nTr).removeClass('row_selected');
$(this.nTr).find("input[type=radio]").removeAttr("checked");
});
$(event.target.parentNode).addClass('row_selected');
});
[/code]
That doesnt work with fixedColumns!.
Then im trying to access to the old datatable model generated before the FixedColumns() call but I can only access to the right part of the table (yes, these with the scroll wrapper).
Any help please?
Thanks a lot
This discussion has been closed.
Replies
[code]
/*
* Example initialisation
*/
$(document).ready( function () {
var oTable = $('#example').dataTable( {
"sScrollY": "300px",
"sScrollX": "100%",
"sScrollXInner": "150%",
"bScrollCollapse": true,
"bPaginate": false
} );
new FixedColumns( oTable );
} );[/code]
you can still use oTable.fnSettings();
the FixedColumns object won't be a DataTable, but you still have a DataTable object.
the code works fine with dataTable without fixed columns but after inicialization of FixedColumns().
[code]
alert("evt:"+event.target);
aPos = tablas[tab].fnGetPosition(event.target.parentNode);
alert("Posicion: "+aPos);
[/code]