Is it possible to bind external data in criteria array of searchBuilder?

Is it possible to bind external data in criteria array of searchBuilder?

csesumonprocsesumonpro Posts: 2Questions: 2Answers: 0
edited October 2023 in Free community support

Original criteria like below:

{
                   condition: =,
                    data: 'Title',
                    origData: 'title',
                    type: 'string',
                    value: keyword
}

I want to set an external key-value pair in this object like below:

{
                   condition: =,
                    data: 'Title',
                    origData: 'title',
                    type: 'string',
                    value: keyword,
                    customKey: customValue
}

I want this data as a payload while I am using the Ajax table. Another problem with search builder, It's to send two requests for server-side rendering one for default and another for searchbuilder. How to protect it?

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • allanallan Posts: 60,903Questions: 1Answers: 9,927 Site admin

    There is no option to send additional data via SearchBuilder's request built in I'm afraid. You could use ajax.data to modify the data sent though, or preXhr.

    Regarding the double Ajax request, I'm not seeing that here? There is a request to examples.php, but that is just specific to the examples (and something I need to fix). Can you give a link to a test case showing the issue please?

    Allan

Sign In or Register to comment.