How to save a condition in a variable to be able to select it later?

How to save a condition in a variable to be able to select it later?

placketsplackets Posts: 3Questions: 1Answers: 0

I don't know how to save the created filter conditions in a variable that I can select later in the future, so I don't have to create the conditions every time I need to look at such data.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583

    If you're referring to SearchBuilder, then this example should help, it's showing just that.

    Otherwise, we're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • placketsplackets Posts: 3Questions: 1Answers: 0

    Link to test case:
    http://live.datatables.net/vofonoqo/4/edit

    Error messages shown:

    Description of problem:
    Enter the following code to exemplify how would be the desired function, in which as you can see in the demo, I would like to create the filter and save them with a name. And these saved filters to be able to choose them and that when selecting it shows the table with the corresponding data.
    Reviewing many forum posts I found something similar that I entered in the code editor, in which are already defined 2 filters to select default, what I want is to create these filters but that is automatic. So I was guided by the example of the previous answer in which it is possible to obtain and show the 'criteria' with the filter entered. But I don't know how to save it in variables entered by the user.
    This is the post that served me as reference: (https://datatables.net/forums/discussion/69670/adding-conditions-to-searchbuilder#latest)
    And check the example of getDetails and getRebuild.

    PD: Sorry for the bad English.

  • colincolin Posts: 15,112Questions: 1Answers: 2,583
    Answer ✓

    I would say hold fire, as we're about to release a new extension called StateRestore, which does exactly that. It's an enhancement to stateSave, where you can name, rename, and store multiple saved states. It should be released in the next week or so,

    Colin

  • placketsplackets Posts: 3Questions: 1Answers: 0

    I will be watching for the release of this extension, hopefully it can be the solution to what I am looking for. Thank you Colin!

Sign In or Register to comment.