Restore Column Visibility via api?

Restore Column Visibility via api?

az1az1 Posts: 14Questions: 7Answers: 1

Hi

Is there a way to restore the column visibility using the api rather than the restore button in the buttons extension?
We currently have an edit button which allows users to then toggle the column visibility.
We also have a cancel button which we then want to restore visibility to the original view.

One way would be to store the original visibility in a variable and then loop through each column and set it's visible property.

Any help appreciated.

regards
Az

Answers

  • colincolin Posts: 15,154Questions: 1Answers: 2,587

    Hi Az,

    Yep, there are two ways you can go.

    The first is to use another button, colvisRestore, as in this example here.

    The second is to call the method columns().visible() directly.

    Cheers,

    Colin

This discussion has been closed.