-
Notifications
You must be signed in to change notification settings - Fork 130
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
multiselect not updating when linked array changes #450
Comments
Thanks Johan. I'll look into it... |
Hi Johan, |
Hi, |
This update should fix your issue, along with a number of other small issues I found, particularly concerning Let me know if it works for you... |
Update - I am checking another possible issue, so probably better to wait before testing jsviews8e, above. I'll keep you posted if there is a corrected version coming... |
OK, I think this update is good. Let me know if you find any issues in your environment' |
I'm moving towards publishing the above a v1.0.8. Of course, if you do find an issue before I actually publish, then I'll put it on hold, but I am pretty sure that for known issues it is good... |
I probably won't be able to test it in the coming days. I'm stuck with some major pita I must attend to first. I'll write back here though when I have tried it. I'm sure it will work tho :) |
Thanks Johan, yes, that's fine. I'll go ahead with what we have. Worst case we'll need a v1.0.9 subsequently. (Which at some point will happen anyway...) |
Feature improvements: - Improvements (and associated bug fixes) when converters return arrays. With minor breakng change for some advanced scenarios: Converters which return arrays now have an improved heuristic behavior to determine whether to return the array (retArray) as value for the first argument, or as an array of values for multiple bindTo/bindFrom targets. (If bindTo/bindFrom is an array of length l, l > 1 and the converter is returning an array retArray of length l, then treat retArray as an array of values for the multiple targets bindTo/bindFrom targets) In addition the heurisic default behavior can be overidden by setting retArray.arg0 = true/false. See http://jsviews.com/#tagoptions@bindto and http://jsviews.com/#hierarchypatterns@picker-multi Several bug fixes, and code improvements, particularly for data-linked <select> tags (including multiselect), and {{checkboxgroup}} tags: - BorisMoore/jsviews#450 multiiselect not updating when linked array changes - BorisMoore/jsviews#449 If the selected value of a data-linked <select> is set prior to adding options, selection is not always established correctly Additional small corrections or improvements to documentation, and some additional unit tests...
Feature improvements: - Improvements (and associated bug fixes) when converters return arrays. With minor breakng change for some advanced scenarios: Converters which return arrays now have an improved heuristic behavior to determine whether to return the array (retArray) as value for the first argument, or as an array of values for multiple bindTo/bindFrom targets. (If bindTo/bindFrom is an array of length l, l > 1 and the converter is returning an array retArray of length l, then treat retArray as an array of values for the multiple targets bindTo/bindFrom targets) In addition the heurisic default behavior can be overidden by setting retArray.arg0 = true/false. See http://jsviews.com/#tagoptions@bindto and http://jsviews.com/#hierarchypatterns@picker-multi Several bug fixes, and code improvements, particularly for data-linked <select> tags (including multiselect), and {{checkboxgroup}} tags: - #450 multiiselect not updating when linked array changes - #449 If the selected value of a data-linked <select> is set prior to adding options, selection is not always established correctly Additional small corrections or improvements to documentation, and some additional unit tests...
Resolved in v1.0.8 |
Please have a look at this fiddle. (code below)
Notice that the select element without the copy converter does not update.
I found that the select element does not update it's selected values when you observably modify the selectedValues array.
I followed the code flow and found this line in jquery.views.js:
623: if (change = change || targetVal !== sourceValue) {
As a workaround I realized I can just create a converter that copies the array so that targetVal and sourceValue are different array instances.
It works but it's not very obvious.
The text was updated successfully, but these errors were encountered: