Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] Let custom templates handle plugin markup #626

Closed
chriskr opened this issue Jan 10, 2018 · 4 comments
Closed

[feature request] Let custom templates handle plugin markup #626

chriskr opened this issue Jan 10, 2018 · 4 comments
Milestone

Comments

@chriskr
Copy link

chriskr commented Jan 10, 2018

We use custom templates and the sortable plugin. We have changed the markup structure a bit. Our issue is that the plugin inserts its markup in a bit a too magic way, not where we would like to have it. It would be better if the according markup could be added to the custom template.

Currently we use an event black list and overwrite the QueryBilder.prototype.on to ignore 'getGroupTemplate.filter' and 'getRuleTemplate.filter' so that we have full control over the markup. One suggestion would be to add an event blacklist to the options with the same purpose.

@mistic100
Copy link
Owner

Too complicated and 100% error prone (what about other plugins using the same events ? developers which will disable the wrong event and break everything ?).

I propose a simple option insert_drag_handle which can disable this block https://github.com/mistic100/jQuery-QueryBuilder/blob/dev/src/plugins/sortable/plugin.js#L148-L161

@chriskr
Copy link
Author

chriskr commented Jan 10, 2018

Ok, sounds good. To be sure that I understand you correctly, insert_drag_handle would be an optional flag on the plugins options. If it is set to false, that block will be disabled. I create an according pull request tomorrow.

@mistic100 mistic100 added this to the 2.4.6 milestone Jan 10, 2018
@mistic100
Copy link
Owner

Done, Added "disable_template" option for plugins invert, not-group, sortable

@chriskr
Copy link
Author

chriskr commented Jan 10, 2018

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants