Is there a way to render the title of SearchBuilder?

Is there a way to render the title of SearchBuilder?

MatanmklMatanmkl Posts: 4Questions: 2Answers: 0
edited May 2021 in Free community support

Hi,
I was wondering is there any way to render SearchBuilder title as HTML?
I'd like to have something like that:

language:{
            searchBuilder:{
                title:{
                    0:'<p class="class="font-weight-bold"">Conditions-Based Filtering:</p>',
                    _:'<p><span class="font-weight-bold">Conditions-Based Filtering</span> - currently applying %d conditions:</p>'
                }
            },

        },

Answers

  • colincolin Posts: 15,237Questions: 1Answers: 2,599
    Answer ✓

    Yep, that seems reasonable, we'll add that functionality (DD-1985 for my reference), and we'll report back here when there's an update.

    Colin

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

    Hi @Matanmkl ,

    That should be the issue fixed now as you can see at this example.

    This will be available in the next SearchBuilder release which we hope will be in the next few weeks. Until then you can access the fix from the nightly builds.

    Thanks,
    Sandy

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    Not specific to SearchBuilder - I've never understood what this syntax means:

                    {
                        0:'.... ',
                        _:'....'
                    }
    

    Any advice appreciated.

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @tangerine ,

    It allows strings to be different dependant on a numerical value. If we demonstrate this using selected rows, which is set using language.select.rows, it states in the docs.

    As an object this option can be used to define different strings to use for the various singular, plural, dual, etc options required by many languages. If the number of rows selected matches a parameter name in the object, the value of that parameter will be used. If there is no match the _ (which must be defined) is used as the default.

    As with the string case above, any of the parameter values defined in this object can contain the string %d which will be replaced with the number of rows selected.

    So to give an example, if you had no rows selected you might want to display

    There are no rows selected.

    If there was 1 row you might want to display

    There is 1 row selected.

    And for more than 1, say 5 you might want to display

    There are 5 rows selected.

    The differences between these are subtle, but important for many languages.

    Hope this helps,
    Sandy

  • tangerinetangerine Posts: 3,365Questions: 39Answers: 395

    Thank you, Sandy. I hadn't seen that page of the docs.

  • MatanmklMatanmkl Posts: 4Questions: 2Answers: 0

    Thanks for the quick response.

  • sandysandy Posts: 913Questions: 0Answers: 236

    No worries :)

  • MatanmklMatanmkl Posts: 4Questions: 2Answers: 0

    @colin Is there any release with this feature on its way?

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

    Hi @Matanmkl ,

    This was released in version 1.1.0 of SearchBuilder back in June. Take a look at this example.

    Thanks,
    Sandy

  • colincolin Posts: 15,237Questions: 1Answers: 2,599
    Answer ✓

    Yep, very soon. We had aimed for the end of last week, but we're slipping slightly. It'll definitely be by the end of this week, possibly before mid-week.

    Colin

Sign In or Register to comment.