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

View only?

Open ksrb opened this issue 8 years ago • 6 comments

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?

ksrb avatar Jun 13 '16 18:06 ksrb

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.

mistic100 avatar Jun 13 '16 19:06 mistic100

If there is no other way I guess a recursive method is the only way to go about making everything read only.

Thanks!

ksrb avatar Jun 13 '16 19:06 ksrb

This feature is what I need in a project also. Looking forward to it being implemented.

brett-walker avatar Jun 30 '16 06:06 brett-walker

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.

ksrb avatar Aug 16 '16 21:08 ksrb

Actually, in options you can set up your own templates, get the default templates and remove the buttons from there.

ianido avatar Sep 09 '16 18:09 ianido

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.

ferreira-guilherme avatar Apr 26 '19 22:04 ferreira-guilherme