How to remove stateRestore UPDATE button

How to remove stateRestore UPDATE button

trongarttrongart Posts: 222Questions: 51Answers: 0

I can see here that it is possible to set the following to false within the stateRestore config:

create: false
remove: false
save: false
rename: false

But there is no update: false

How can I remove only the UPDATE button so that only RENAME and DELETE buttons remain when a user interacts with a saved state (also creation of new states remains)?

Answers

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736
    edited July 2022

    It looks like the Update button doesn't appear in this test case:
    http://live.datatables.net/yenijura/1/edit

    I added the createState button so you can add a state. The save: false is commented out. Create a new state if needed. Open the state and you will see the Update button. Uncomment save: false and re-run the example. Open the state and you won't see the Update button.

    The docs for stateRestore.save state this:

    It is important to note that this does not only affect updating states, but also creating and renaming of states.

    Kevin

  • trongarttrongart Posts: 222Questions: 51Answers: 0
    edited July 2022

    Kevin thank you very much for looking into this! I am using the alternative UI as in this test case. The goal is to not see the UPDATE button in the menu when you click on the arrow of any of the saved states. save: false does not remove it as far as I see. Only the Rename and Remove options should be there (as well as Create State in the main menu).

  • trongarttrongart Posts: 222Questions: 51Answers: 0

    Solved it as in this test case. It works with Ajax and does not display the Update button.

  • trongarttrongart Posts: 222Questions: 51Answers: 0
Sign In or Register to comment.