-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
Fix select2 value updation for crmAddName Directive #11979
Conversation
Can one of the admins verify this patch? |
8cd66ad
to
91dc528
Compare
91dc528
to
c0bb8bd
Compare
@monishdeb @colemanw one for you guys to look at |
@civicrm-builder add to whitelist |
Hey @deb1990 thanks for the contribution! Do you have any idea why the existing |
To answer my own question, I've run into this type of thing before and the answer was to either pass |
@colemanw The watch function was not the problem, as the watcher was getting fired correctly whenever values are changed, but the problem was with |
Overview
In
ang/crmCaseType.js
,crmAddName
directive is present. But if the scope variable mentioned incrm-options
is updated with new values, the select2 dropdown does not get updated with new values.This PR fixes the problem.
Before
The dropdown values does not update
After
The dropdown values updates
Technical Details
How to reproduce?
'Scope variable updated'
is printed but the dropdown values are not updated.Problem
Previously the code used to update the the
select2
was$(input).select2('data', scope[attrs.crmOptions]);
, but it did not work.Solution
Using a function instead of a variable inside the
data
object, solved the problemSource: https://stackoverflow.com/a/17348414/2400594