how to fetch columns visible stat on preInit event

how to fetch columns visible stat on preInit event

GM_LinGM_Lin Posts: 3Questions: 2Answers: 0

my javascript
var table=$('#sls_app_list').DataTable({
ajax: {
url: "_ajax.php",
data:function( d ) {
d.oper= "init";
d.year= $("#year").val();
},
error:handleAjaxError
},
"columns": [
{
"className": 'details-control',
"orderable": false,
"data": null,
"defaultContent": ''
},
{"data": null, "title": ""}, //1
{"data": "ID", "title": ""},
{"data": "NAME", "title": "NAME_TITLE"},
{"data": "ID2", "title": "ID2_TITLE"}
],
"columnDefs": [ {
"targets": [0,1,2],
"visible": false,
"searchable": false
}]
});

i wish get data information on preInit event ,like this:

if(column[sel].visible){
console.log(column[sel].data);//ex : sel=4 then data is ID2
}

how can i do it?

Answers

  • allanallan Posts: 40,558Questions: 1Answers: 4,957 Site admin

    The column().visible() method can be used to determine if a column is visible or not.

    Allan

Sign In or Register to comment.