Searchbuilder SSP dropdown value

Searchbuilder SSP dropdown value

ECEGROUPEECEGROUPE Posts: 77Questions: 28Answers: 1

Is this possible to use seachbuilder SSP and have a dropdown with pre-populated value from my table and also with personalized value ( for exemple display "ok" in the dropdown but the value in the table is 1) ?

I have set up my searchbuilder like in exemple bellow but as you can see there is no dropdown : https://editor.datatables.net/examples/extensions/searchBuilder.html

Thx for your help

This question has an accepted answers - jump to answer

Answers

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

    Thanks for the question. We'll get back to you in a couple of days with a response,

    Colin

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @ECEGROUPE ,

    I'm afraid that currently this is not possible. When using serverside processing, SearchBuilder does not implement any select elements. Typically, you would use SSP when you were processing a lot of data. Using input elements is an optimisation to allow SearchBuilder to run much faster. If you had a column with thousands of distinct values then a select element would quickly get bogged down and the page would run really slowly. There would also be significantly more calls to the server on the server side.

    Using input elements removes all of these problems, so that is what we have implemented.

    Thanks,
    Sandy

  • ECEGROUPEECEGROUPE Posts: 77Questions: 28Answers: 1
    edited March 2022

    Ok, thanks for yours answers.
    Then i have another question : is it possible to use custom conditon with Searchbuilder SSP ?

    https://editor.datatables.net/examples/extensions/searchBuilder.html
    For exemple i click on add condition -> First name -> and then i have a dropdown with predefined values that never change ( yes, no and maybe ) where yes = 1 in my table, no = 2, maybe = 3.

    Thx :)

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

    Unfortunately not, the SSP scripts currently don't support custom conditions.

    Colin

  • ECEGROUPEECEGROUPE Posts: 77Questions: 28Answers: 1

    Thank for your answer,

    is this going to be implemented is the next version of SearchBuilder / soon?

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @ECEGROUPE ,

    We've been talking this over this morning and have decided to have a go at implementing some of this. We are not going to implement custom conditions on the serverside, but we are going to add a way to make SearchBuilder use a select element rather than an input element.

    This will mean additional calls on the serverside, and a bit of trust in developers to use it appropriately, but we think it will be worth it so that columns with few distinct values can use select elements. By default this will query the table for all of the distinct values in the column, and return this data to the client side for SearchBuilder to render into a select element. For you to insert your own options you will be able to edit the data either before it is returned from the server, or on the client side using the xhr event.

    I've raised an issue internally (DD-2503 for my reference) and will report back here when there is an update.

    Thanks,
    Sandy

Sign In or Register to comment.