What is the recommendation for having the cascading combo take affect when the first combo has a selected item when it is loaded? This doesn't appear to trigger the selectionchanged event recommended in the example. Is there a bug here that the event is not triggered when the control loads and applies the selectedItem?
http://www.igniteui.com/combo/cascading-combos
Hello,
Thank you for contacting us!
About your question, could you please be more clear. As I understand you want then the combo is loaded, with selected item, automatically the second combo to be filled with data according to first combo value.
As you will notice the combos are filled with data on selectionChanged client event.
Yes so if the screen loads and the user selects UPS for example from a Carrier dropdown the selectionChanged event fires and the Service dropdown then filters. It does not work however if the screen loads and the combo binds to the view model using the selectedItems property to default the selection of the combo when the page loads. That default selection does not trigger the selectionChanged event so the filter of the 2nd combo does not happen. Is that a bug? How should cascading combos be handled when the page loads with a default bound value?
This is closer but rebinding the child combo causes itemsRendered to be called over and over again. I added an alert in your fiddle. Select a state and you will see it.
I will just stick an attribute on the combo so I know its already rendered.
As an FYI I ended up having to use the dropdownOpening event to evaluate this. We are using knockout binding and for some reason with the other event the dropdown was getting filled incorrectly.
Hello Tammy,
Thank you for sharing the solution that you found. I am glad to hear that you were able to find a solution that works for you at this time.
Please let me know if I may be of any additional help.
I am good right now other than hoping you'll build this into a future release :)