Angular-QueryBuilder icon indicating copy to clipboard operation
Angular-QueryBuilder copied to clipboard

Add custom rendering functions

Open getlarge opened this issue 4 years ago • 0 comments

Hey, i would like to propose you some little changes in your excellent library, sorry in advance for the lint changes, it will be fixed on another commit if you require it.

Currently we're using it in a project and we needed the ability to customize the conditions, fields and buttons based on the context of the tree.

So first, i added a function to add metadata to the rules / rulesets when changes occur and extended the Rule and RuleSet interfaces with depth, index and parentIndex. Then i created several other functions :

  • to check the ruleset depth to control how to display the buttons.
  • to retrieve the parent ruleset from a field so that we can apply logic on how to display the fields list
  • to display conditions and fields in a custom way with getConditions and getFields that can be overridden in queryBuilderConfig

I would be happy to know your feedback and bring further explanations if needed.

getlarge avatar Jul 12 '20 11:07 getlarge