Angular-QueryBuilder
Angular-QueryBuilder copied to clipboard
Add custom rendering functions
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
andgetFields
that can be overridden inqueryBuilderConfig
I would be happy to know your feedback and bring further explanations if needed.