Reputation: 7722
I want to provide a back-end application to my customers, where they can set-up some rules by dragging and dropping, which would be processed on page call.
This is how it should work: There are some basic elements of which the customer can build some IF
blocks, e.g.
<request_url> CONTAINS <term_xyz>
<agent> EQUALS 'Chrome'
and so on. Now I'm looking for an jQuery plug-in to provide an easy drag and drop solution for concatenating these block to a formula using boolean operators, like
((condition_1 OR condition_2) AND condition_3) OR (condition_3 AND condition_4)
With this formula I can trigger some operations, so in the end there would be an instruction like
IF <formula> THEN <do_something>
which allows my customers to build absolutely flexible instructions.
My question is now: Is there any ready-to-use jQuery plugin which can be used to build this formula via drag and drop based on the conditions?
Note: I know how to handle and code this functionality in my application to process these instructions, but I need some help to get the formula with all round brackets and boolean operators from front-end. And I also know of jQuerys "Droppable" and "Sortable", but that's only the last option for me to build it on my own with these.
Upvotes: 3
Views: 1577
Reputation: 8859
I once needed a script to build compley AND/OR rules and used jQuery Query Builder.
It doesn't support drag&drop by default but has a plugin (that I never used).
At the least you could take this as a starting point and expand it to fit your needs.
Hope it helps.
Upvotes: 2