Why doesn't visible: false work?
Why doesn't visible: false work?

var dt_table = $('#radiological').DataTable({
language: dt_language, // global variable defined in html
order: [[ 1, "desc" ]], //order by column1 or mrn
lengthMenu: [[10, 25, 50, 75, 100], [10, 25, 50, 75, 100]],
columnDefs: [
// {orderable: true,
// searchable: true,
// className: "center",
// visible: false,
// targets: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
// },
// {orderable: true,
// searchable: true,
// className: "never",
// visible: false,
// targets: [10, 11, 12]
// },
{
data: 'id',
targets: [0]
},
{
data: 'mrn',
targets: [1]
},
{
data: 'acc_d',
targets: [2]
},
{
data: 'cat_d',
targets: [3]
},
{
data: 'desc_d',
targets: [4]
},
{
data: 'acc_r',
targets: [5]
},
{
data: 'cat_r',
targets: [6]
},
{
data: 'desc_r',
targets: [7]
},
{
data: 'td',
targets: [8]
},
{
data: 'is_annotated',
targets: [9]
}
,
{
data: 'discharge_summary',
className: "never",
visible: false,
targets: [10]
},
{
data: 'addendum',
className: "never",
visible: false,
targets: [11]
},
{
data: 'radiology_report',
className: "never",
visible: false,
targets: [12]
}
],
searching: true,
processing: true,
serverSide: true,
stateSave: true,
ajax: TESTMODEL_LIST_JSON_URL
});
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
My guess is you have
stateSave: true,
and you changed the settings but due to the state being saved it reverts back to the previous setting when reloading the Datatable. As a workaround you san usestateDuration
and set it to w low value, like 1 second, reload the page and your display is probably correct now. Once its correct you can remove the setting.Kevin
Thank you - that worked.