jQuery-QueryBuilder
jQuery-QueryBuilder copied to clipboard
View only?
Is there a way to disable editing of the entire query builder and make it view only?
I realize there are various read only parameters you can pass to each rule and group but this isn't a ideal way to 'disable' the entire query builder.
Also you can still add rules/groups to a group even when it's set as readonly, is that the intended behavior?
There is currently no other way.
You are right, the group readonly
is only partly supported (only locks the condition and prevents delete). I am currently working on enhancing the template (with angular-like live refresh) for #301 and this will be enhanced.
If there is no other way I guess a recursive method is the only way to go about making everything read only.
Thanks!
This feature is what I need in a project also. Looking forward to it being implemented.
Still interested in this just haven't had a chance to test it.
If anyone has any ideas how to build this module using webpack that would be cool 😄 .
Currently I have solved this using a method that just goes through the DOM and removes the buttons.
Actually, in options you can set up your own templates, get the default templates and remove the buttons from there.
I'm doing this:
$('button', element).prop('disabled', true)
$('select', element).prop('disabled', true)
$('select', element).trigger("chosen:updated")
$('input', element).prop('disabled', true)
Not so good, but for now, it works.