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

Global event if form has been modified #498

Closed
nikataus opened this issue May 25, 2017 · 7 comments
Closed

Global event if form has been modified #498

nikataus opened this issue May 25, 2017 · 7 comments
Labels
feature New feature
Milestone

Comments

@nikataus
Copy link

Hi,

I'm trying to add window.onbeforeunload where popup shows if the user leaves the page. I also want to implement something like dirtyForm flag, if the user has made any changes to the form and in general I want to catch all events like add new Rule, add new Group, change filter, change operator, change values, etc.
I know I can implement all events and change this flag there, however I wanted to check if there is something like global event that will catch all these, and only implement it there, instead of all events.
Let me know if you have any ideas to optimize my code.
Thanks for your help!

@monice
Copy link

monice commented May 28, 2017

$('#builder').on('afterCreateRuleInput.queryBuilder afterUpdateRuleFilter.queryBuilder afterUpdateRuleOperator.queryBuilder', function(e, rule) {
    switch (rule.filter.id) {
        case 'group_by':
            // ...your code
            break;
    }
});

@nikataus
Copy link
Author

Hi Monice,

I don't think you're catching all events:
For example - changing the values select control or changing the condition group element (AND/OR).
Thanks,

@monice
Copy link

monice commented May 31, 2017

All events is here: http://querybuilder.js.org/api/list_event.html. The above code is just my a usage, you can custom it. JavaScript is openness programming language.

@nikataus
Copy link
Author

Thank you.

@mistic100
Copy link
Owner

I will add a global "change" event.

@mistic100 mistic100 added the feature New feature label Jun 2, 2017
@mistic100 mistic100 added this to the 2.4.4 milestone Jun 2, 2017
@nikataus
Copy link
Author

nikataus commented Jun 5, 2017

Great! Thank you.

@mistic100 mistic100 modified the milestones: 2.4.4, 2.4.5 Jul 10, 2017
@nikataus
Copy link
Author

Hi there, any information on when you will release 2.4.5?
Thanks!

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

No branches or pull requests

3 participants