-
Notifications
You must be signed in to change notification settings - Fork 553
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
Pass previous operator to afterUpdateRuleOperator event #547
Conversation
Could also do it for afterUpdateRuleFilter, afterUpdateRuleValue and afterUpdateGroupCondition ? (these needs to update the method calls on core.js lines 285 and 300) |
I'm on it, but ... updateRuleValue is called also in updateRuleOperator function (just after afterUpdateRuleOperator event) - what should be passed there? QueryBuilder.prototype.updateRuleValue = function(rule, oldValue) {
...
} but updateRuleOperator doesn't change the rule value ... so ... undefined? EDIT: Well - it changes value in one case: if (!rule.operator || rule.operator.nb_inputs === 0) { ... } so I will copy value of |
@mistic100 Is it enough to merge? |
There is a pending review. |
@giero there is still a pending review |
src/core.js
Outdated
@@ -723,6 +726,7 @@ QueryBuilder.prototype.updateRuleFilter = function(rule, previousFilter) { | |||
*/ | |||
QueryBuilder.prototype.updateRuleOperator = function(rule, previousOperator) { | |||
var $valueContainer = rule.$el.find(QueryBuilder.selectors.value_container); | |||
var ruleValue = rule.__.value; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can just use rule.value
, __
is only useful to set the value without triggering an update event
@giero Sorry the review was not published, I didn't see it because the behavior changed some months ago |
@mistic100 |
Added previousOperator to 'afterUpdateRuleOperator' event - could be useful in some cases ;)