How to retrieve a searchBuilder's condition's "conditionName" property

How to retrieve a searchBuilder's condition's "conditionName" property

keytrapkeytrap Posts: 15Questions: 2Answers: 2
edited June 2024 in Free community support

Link to test case: https://live.datatables.net/dubevewa/3/edit
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem: I need to get the conditionName property from any searchBuilder's condition. How can I access this property ?
I have try searchBuilder.getDetails() but It doesn't have the conditionName property, only the condition property which is not what's shown to the user.

What i'm trying to do is to have a recap in string format of all the searchBuilder's current criterias, and instead of having xxx = xxx I want xxx is equals (or whatever you have set it) to xxx.
I have kinda found a way but it doesn't seem to be very clean to access it like that ?

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    edited July 2024

    Unfortunately, it's not part of the API, but you can go deep into the settings object. to retrieve it. You can use settings() to get the settings, then

    [0]._searchBuilder.c.conditions["num-fmt"]["+-5"].conditionName
    

    to get the value. Not ideal, but it may give you a solution,

    Colin

  • keytrapkeytrap Posts: 15Questions: 2Answers: 2
    edited July 2024

    Hi @colin, yes, this is what I ended up doing and even though it's not pretty, it works !

Sign In or Register to comment.