StateSaveCallback With ColReorder

StateSaveCallback With ColReorder

cristianojcruzzzcristianojcruzzz Posts: 4Questions: 2Answers: 0
edited June 2019 in Free community support

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.

Answers

This discussion has been closed.