Cannot read property 'style' of undefined

Cannot read property 'style' of undefined

master_barkermaster_barker Posts: 1Questions: 1Answers: 0

var table = $(".candidate-list").dataTable({
scrollY : 300,
scrollX : true,
bPaginate : true,
bProcessing : false,
sAjaxSource : url,
aoColumns : [
{ "mDataProp" : "checkbox"},
{ "mDataProp" : "first_name"},
{ "mDataProp" : "last_name"},
{ "mDataProp" : "city"},
{ "mDataProp" : "phone1"},
{ "mDataProp" : "phone2"},
{ "mDataProp" : "email_address"},
],
dom: "<'col-sm-2'C><'col-sm-2'l><'col-sm-8'f>tip",
colVis : {
stateChange : function(){
var cols = TableSettings.getState(table);
var data = {
'_token' : $('meta[name="csrf-token"]').attr('content'),
'data' : cols
};
var url = 'save_settings';
$.post(url,data,function(response){ return true; });;
},
exclude : [0]
},
columnDefs : [def]
});

So I'm using both ColVis and Scroller, the error was not present until I added the scroller. The error show when I try to show the column that I previously hide using the colvis and the header and body are not on the same width. What could possible the cause of this error? Thanks.

Answers

  • allanallan Posts: 63,791Questions: 1Answers: 10,513 Site admin

    Thanks for your question - however, per the forum rules can you link to a test case showing the issue please. This will allow the issue to be debugged.

    Information on how to create a test page, if you can't provide a link to your own page can be found here.

    The most likely cause is that the HTML doesn't have exactly 7 columns (per your Javascript), but without a test case it is impossible to say.

    Thanks,
    Allan

This discussion has been closed.