fixing column disables tr on click
fixing column disables tr on click
DataTable setup:
oTable = $('#planning').dataTable({
"aaData": dataSource["aaData"],
"aoColumns": tableColumns,
"bFilter":false,
"bSort":false,
"sScrollX": "100%",
"bScrollCollapse": true,
"bInfo":false,
"bLengthChange":true,
"bPaginate":false
});
/* first column fixed */
new $.fn.dataTable.FixedColumns( oTable, {
leftColumns: 1,
rightColumns: 0
});
/* listen clicks on first column */
$(document).on( "click", "#planning td:first-child", function() {
var nTr = getSelectedRow($(this).html());
toogleRow($(this).closest('tr'), nTr);
});
Problem is, clicks on the first column are not captured on the first column in the table if new $.fn.dataTable.FixedColumns( oTable, {.... is executed. If no fixed column is set, clicks on the 1st column works properly.
Need both things to work together, any suggestion?
Replies
I've solded this just binding the click event to the column before calling to new $.f.dataTable.FixedColumns....
Hope this could help others. :)
I fixed teh first column, but I needed access to the custom attribute containing an ID that I need when the users clicks the on the first column. Here's how I did it. I had to put the event listener on the tr belonging to the fixed column. Then I had to pick up the ID from the underlying table.