-
Notifications
You must be signed in to change notification settings - Fork 7
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
WSDropDown: Changes made to pickers are not always synchronized to dropdown #166
Comments
The problem is caused by the fact that synchronization events are wired when WSDropDown assigns a picker for the first time using e.g. A quick and dirty solution to this would be to call The solution above will cause TreeView to become rooted and therefore load data: We would need to move the logic responsible for wiring synchronization events in |
#165: Changes to WSDropDown's value was not synchronized to WSTreeView picker if one of the WSListView pickers (for search and action menu items) was the active picker. This resulted in the previous value being restored when calling wsDropDown.ClearData() and wsDropDown.AutoUpdateSelected() to resolve updated display values for the newly assigned dropdown value. This has now been fixed by ensuring that WSTreeView is always kept up to date with the current selection state in WSDropDown as they happen, rather than "catching up" when WSTreeView is set as the active picker control. #166: Changes made to selection state via a WSDropDown's picker control directly (e.g. dd.GetTreeView().EnsureData(function(sender) { sender.GetChild("ROOTNODE").Selected(true); });) would not propagate to host control (WSDropDown) unless pull down menu had been opened first, which would set up the necessary synchronization events. This has now been resolved. Also fixed a bug in WSTreeView where clearing the control with Value("") would add a preselection with an empty value.
The issue has now been resolved. However notice that changes to selection state only propagates to the WSDropDown control if nodes actually exist in the WSTreeView instance. Setting a value or node selection on the WSTreeView instance using
To be determined: Should selection of non-existing nodes be synchronized to DropDown control when assigned via picker control? It works when assigned via DropDown control. |
See the following example: https://jsfiddle.net/9zca6kf1/1/
Click the button to load TreeView data and select the first node. Do NOT open the DropDown control first!
Notice how the selection is not reflected in the DropDown control. Now open the DropDown - this results in TreeView being updated with the selection from the DropDown control (which is empty), so the selection in the TreeView is lost.
The same problem might occur if data returned from the server contain nodes that are preselected. These selections will also not propagate to the DropDown control, and they will be lost when DropDown control is opened.
If we open the DropDown control first, before clicking the button, synchronization works as expected.
This is a minor bug since we would normally use the DropDown instance to change selection:
dd.AddSelection("Title goes here", "Unique Value")
The text was updated successfully, but these errors were encountered: