When creating button in StateRestore SecondarySplit is it possible to know which state button is for

When creating button in StateRestore SecondarySplit is it possible to know which state button is for

desperadodesperado Posts: 159Questions: 33Answers: 4

This is my third (and hopefully last) issue :smile:

Test Case: http://live.datatables.net/piqeheyu/1/edit?js,output

See comment in test case, trying to get access to the Saved State ID when creating the Secondary Split button.
I have a use case where I would like to change the label based on a certain state of the specific "Saved State".
I have the code to check for the condition but I don't have access to the correct StateId to make it work.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,177Questions: 1Answers: 2,590

    We'll take a nose to this and the other two when Sandy returns in the new year!

    Colin

  • desperadodesperado Posts: 159Questions: 33Answers: 4

    @colin OK no worries. Happy New Year! Sandy tried to help with this issue in another "answered" thread but the case I presented was confusing and I think distracted from what I wanted to do. I didn't understand how to apply the answer so I decided to break out the questions and make each test case more simple. Cheers!

  • sandysandy Posts: 913Questions: 0Answers: 236
    Answer ✓

    Hi @desperado ,

    The buttons.buttons.text function is one of the first to be run, so the _stateRestore property is not going to be available at that point. Instead you will have to use the init function and do something along the lines of the following example.

    Thanks,
    Sandy

  • desperadodesperado Posts: 159Questions: 33Answers: 4

    @sandy Very cool! That's exactly what I needed!

Sign In or Register to comment.