Hi there
I want to enable/disable column resizing on a datatable as we have an edit and cancel button to toggle this functionality on and off.
So far I have only been able to do this as follows:
-
on datatable initialise, exclude columns from resize - this works
"colResize": {
"exclude": [0, 1, 2]
},
-
In our edit button click event, use the api to allow all columns to resize - this works
var table = $('#dataTableSites').DataTable();
new $.fn.dataTable.ColResize(table, {
"exclude": []
});
- In our cancel button click event, try to disable the resize again - both these fail
var table = $('#dataTableSites').DataTable();
new $.fn.dataTable.ColResize(table, {
"exclude": [0,1,2]
});
new $.fn.dataTable.ColResize(table).fnReset();
this gives the following error:
Uncaught TypeError: this.s.dt.adjust is not a function
at ColResize.fnReset (dataTables.colResize.js:216)
Can anyone help?
regards
Az
Hi there
I want to enable/disable column resizing on a datatable as we have an edit and cancel button to toggle this functionality on and off.
So far I have only been able to do this as follows:
on datatable initialise, exclude columns from resize - this works
In our edit button click event, use the api to allow all columns to resize - this works
var table = $('#dataTableSites').DataTable();
new $.fn.dataTable.ColResize(table, {
"exclude": []
});
var table = $('#dataTableSites').DataTable();
new $.fn.dataTable.ColResize(table, {
"exclude": [0,1,2]
});
new $.fn.dataTable.ColResize(table).fnReset();
this gives the following error:
Uncaught TypeError: this.s.dt.adjust is not a function
at ColResize.fnReset (dataTables.colResize.js:216)
Can anyone help?
regards
Az