Custom condition on specific field
Custom condition on specific field
Hello all,
I'm developing a webapp using django and django-restframework-datatable, no problem at all managing table with a simple global search. I tried to add searchbuilder extension (serverside) and have partial succes.
My problems are:
1) No selectable value in dropdown for string and number condition
2) No calendar object apper for date field
My question is basically related to point number 1 and is:
- can I have a custom condition on field, I mean can I have different custom condition for each field?
Not able to find answer myself in the manual and also in the forum didicated to searchbuilder
tnks
Answers
The SearchBuilder server side processing docs state this:
Also in the docs:
I believe the django-restframework-datatable library examples implement server side processing. not sure if its required for that library to work. Possibly you don't need to use server side processing and can turn it off to get these features. See the Processing modes docs for more details.
My guess is the date format is not recognized by SearchBuilder. You may need to use moment.js as shown in this example or Luxon as shown in this example.
Kevin
Thnaks for the reply.
I don't understand very well this part:
This mean that there's no corresponding https://datatables.net/extensions/searchpanes/examples/customFiltering/customOptionConditions.html
in search builder?
Yes, SearchBuilder can be extended as shown in this example.
That is client-side though - so if you are using server-side processing, your server-side scripts would need to be modified for the custom conditions as well.
Allan
The behavior you're describing, where there are no selectable values in the dropdown for string and number conditions, might be due to a configuration issue or an inconsistency in the way you've set up the SearchBuilder extension. You should ensure that you've configured your DataTable properly to handle string and number conditions. Double-check your code to ensure that you've included the necessary options for these conditions.
@teresaharris and @hashirshabbir please see the SearchBuilder server side processing docs. As mentioned above the docs state this:
Kevin