State Restore collection inherits other collections sub-buttons

State Restore collection inherits other collections sub-buttons

Benjamin.Smith@OptimalAnswers.comBenjamin.Smith@OptimalAnswers.com Posts: 15Questions: 2Answers: 0

Link to test case: https://jsfiddle.net/benjamin_smith_optimal/ctvbsuz0/20/
Debugger code (debug.datatables.net): Couldn't work it with fiddle
Error messages shown: None
Description of problem: In the buttons.buttons of savedStates button, the collection "imports" the collection of other buttons instead of its own.

In the fiddle, see the Sub button appears in the savedStates collection (from the other button's collection) instead of the createState button.

Replies

  • allanallan Posts: 63,482Questions: 1Answers: 10,467 Site admin

    Right enough! Thanks for the test case for this. I'll post back when I've had a chance to look at it (should be later this afternoon).

    Allan

  • allanallan Posts: 63,482Questions: 1Answers: 10,467 Site admin

    Fix committed here. The nightly will be updated with the change soon.

    Thanks again for flagging this up!

    Allan

  • Benjamin.Smith@OptimalAnswers.comBenjamin.Smith@OptimalAnswers.com Posts: 15Questions: 2Answers: 0

    :) :) :)

  • Benjamin.Smith@OptimalAnswers.comBenjamin.Smith@OptimalAnswers.com Posts: 15Questions: 2Answers: 0

    Fixes the corruption issue! Thank you.

    I'm losing the buttons.buttons prepend though (adding a createState). Is it part of the same area? I'll get a fiddle up once I the nightly is available. For now, I manually entered the commit change into local file.

    To repro, the Create button is in the collection if no states are stored. Once a state is added I lose the button. Also (possibly unrelated), I lose the text override as well (reverts to Saved States). A page refresh is sometimes required after state adding/removing to get the behavior.

  • allanallan Posts: 63,482Questions: 1Answers: 10,467 Site admin

    Urgh - yes, sorry. The nightly is up to date, and right enough there is still an error when saving the state. I think it is exactly the same thing, just in a slightly different area of the code. I'll check that when I'm in the office tomorrow morning.

    Allan

  • allanallan Posts: 63,482Questions: 1Answers: 10,467 Site admin

    Fix for the same sort of error committed here.

    Regarding the text issue, this is happening because of the ability to update the text to show the number of saved states.

    What to do is set the button text through the buttons.savedStates language option - e.g.: https://jsfiddle.net/q0n2powy/ .

    It does seem a bit odd that - I'll have a think about how we can improve that. It might need a new API in Buttons...

    Allan

  • Benjamin.Smith@OptimalAnswers.comBenjamin.Smith@OptimalAnswers.com Posts: 15Questions: 2Answers: 0

    Awesome! Thank you so much!

Sign In or Register to comment.