Hi,
I am using KTDatatables Metronic v7 and want to toggle column visibility.
datatable.column(parseInt(val)).visible(false);
datatable.reload();
Hi Tristan,
Sorry for the delay. Glad you found it. Feel free to let us know if you need any help.
Thanks
I checked the example of again
\theme\demo1\src\js\pages\features\ktdatatable\api\methods.js
and applied it to my code. It works now. Thanks!
Hi Tristan,
Sorry for the inconvenience. Please note that we have stopped providing updates for KTDatatables since Metronic v8. For future data table updates, we use the Datatables.net plugin.
In our online demo, showing and hiding a column is working.
https://preview.keenthemes.com/metronic/demo1/crud/ktdatatable/api/methods.html
In file;
\theme\demo1\src\js\pages\features\ktdatatable\api\methods.js
Please try to use datatable.columns instead of datatable.column function.
datatable.columns(parseInt(val)).visible(false);
Hi!
I tried to use columns instead of column, but this give error:
TypeError: undefined is not an object (evaluating 'delete options.columns[index].visible')
Hi,
Could you please try to use this function?
datatable.redraw();
I tried. Does not work unfortunately.
datatable.column(parseInt(val)).visible(true);
datatable.redraw();