Dynamically make columns visible
Dynamically make columns visible
I have multiple datatables in which I am hiding some of the columns by default when initializing the datatable. For only one of the tables I want to display all the columns.
Later on, I get a reference to the table using below statement.
'''
var sourcetbl = jQuery('#container > div label:contains("Other data")').parent().parent().parent().find('.MyTable').DataTable();
sourcetbl.columns([1, 2, 3, 4, 5, 6, 7]).visible(true,false);
'''
This is causing problems and results in error message
Line: 3922
Error: '0.style' is null or not an object
The functionality seem to work fine, but the error message is thrown for every row that gets displayed. Any suggestions?
The statement where I'm getting referenc to my table using object.DataTable() seems to be causing issues. Not sure why.
Answers
It works fine, when everything is plain html, but when I am using asp.net repeater and populating data from serverside is what is causing issue.