StateSaveCallback With ColReorder
StateSaveCallback With ColReorder

I'm using save state, but is not working with ColReorder.
I need to hide some columns from certain users, and I'm using stateSaveCallback and stateLoadCallback to do the function.
They are doing, however, they are not saving the order of the columns (colReorder).
I do not know what I'm doing wrong.
My Code:
'stateSaveCallback': function (settings) {
for (let i = 0; i < settings.aoColumns.length; i++) {
if (settings.aoColumns[i].className == 'noPermission') {
settings.aoColumns[i].visible = false;
}
}
},
stateLoadCallback: function (settings) {
for (let i = 0; i < settings.aoColumns.length; i++) {
if (settings.aoColumns[i].className == 'noPermission') {
settings.aoColumns[i].visible = false;
}
}
return settings;
},
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Answers
Hi @cristianojcruzzz ,
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin
Hi @colin, i'm sorry.
The link is:
https://dev.linvix.com.br/login.php?redirect_url=%2Fcadastros%2Fprodutos%2F
User and Password is:
DATATABLES
Open Top menu in CADASTROS > PRODUTOS
This page contains DataTables!!
Thank you!
Hi @colin
I was able to solve it, I identified that something was changed in the DataTables update.
There is no column className, it is elsewhere.
Excellent, thanks for letting us know.