'colvis' Button With Server Side Processing renders empty buttons
'colvis' Button With Server Side Processing renders empty buttons
Hello,
I am new to using the datatables, but I have updated the datatables to 1.10.8 and was going to use the buttons version of the show/hide columns. I'm using the server side processing and also have dynamic number of columns.
The button 'colvis' has been added as shown in the buttons example but the titles/values of these buttons are rendered empty.
$(tableSel).DataTable({
"paging": paging,
"dom": 'Bfrtip',
buttons: [
{
extend: 'colvis',
postfixButtons: [ 'colvisRestore' ]
}
],
"colReorder": true,
"destroy": true,
"stateSave": true,
"stateSaveParams": function (settings, data) {
data.search.search = "";
},
"stateSaveCallback": function (settings, data) {
var jsonData =
$.ajax( {
"url": saveTableStateLink,
"data": {"stateSaveData": JSON.stringify(data)},
"dataType": "json",
"type": "POST",
"success": function () {}
} );
},
"stateLoadCallback": function (settings) {
var o;
$.ajax( {
"url": loadTableStateLink,
"async": false,
"dataType": "json",
"success": function (json) {
o = json;
}
} );
return o;
},
"ajax": {
"url": dataSourceLink,
"type": "POST",
"data": function ( d ) {
d.totalNoOfColumns = columns.length;
},
"dataSrc": function ( json ) {
return JSON.parse(json.data);
}
},
"serverSide": true,
"columns": columns,
"columnDefs": [{
"targets": tableUtils.getTargets(dataprox, tableConfiguration),
"render": function ( data, type, row ) {
if (data instanceof Object){
if (type === 'display'){
var displayData = data._;
if (displayData instanceof Object){
var imgURL = displayData.imgURL !== undefined && displayData.imgURL !== null ? displayData.imgURL : null;
var linkURL = displayData.linkURL !== undefined && displayData.linkURL !== null ? displayData.linkURL : null;
var color = displayData.color !== undefined && displayData.color !== null ? displayData.color : null;
var name = displayData.name !== undefined && displayData.name !== null ? displayData.name : null;
return tableUtils.resolveData(linkURL, imgURL, color, name);
} else
return data._;
} else if (type === 'sort'){
return data.sort !== undefined ? data.sort : data._;
} else if (type === 'filter'){
return data.filter !== undefined ? data.filter : data._;
} else if (type === 'type')
return data.type !== undefined ? data.type: data._;
} else
return data;
}
}
]
});
Here is the datatables debug bookmarklet
http://debug.datatables.net/upaqov
Sorry I could not add the test case, as I couldn't find the buttons extension at live.datatables.net.
Thanks,
shankar