Is it possible to use knockout to only bind the selected value in an igCombo? I am passing the dropdown list from the server side as the datasource for available options. I have a view model that contains a field with only the "selected" value that will be in the list. I want to use knockout just to bind to the selected value both ways - not the list of valid options in the combo.
Hello Ryan,Thank you for contacting Infragistics Developer Support!Could please share a code sample of what you are trying to achieve? Thank you in advance!
Please see attached. I've taken the combo knockout example from Infragistics web site and added another combo box to the bottom of it. This combo box code originated from server side MVC and I copied into this example. The data source for the available options in the combo is also set on server side, so the list is NOT being filled by knockout. I want to bind the combo "selected" value using knockout. I sort of have this working which you can see in the attached example. What's not working is that initially when I open this page, even though Adam Sandler is selected in the list, it is not defaulted in my newly added combo box. I know it is bound correctly though because it's working after that. Here are steps you can go through.
1. Open the page - you'll see Adam Sandler is "selected" in various controls, but not my combo at the bottom. Why is this?
2. Select another actor and then click back on Adam Sandler. Now you can see Adam Sandler is also selected in my newly added combo box, so I know the binding is working correctly in some instances.
3. Add a new actor named LB. Once you do this, you will again see my newly added combo get filled with "Pounds" (the description for LB).
How can I get the correct selected value in the combo box when the page is opened initially using Knockout?
Thanks!
So if I'm understanding you correctly, I take this to mean that knockout binding with igCombo is not really supported if the igCombo is initialized via MVC Helpers? Is that accurate? Or at the very least you wouldn't recommend it?
Hello Ryan,It is supported but I wouldn't recommend it. If you can provide me another sample in Asp MVC this time, with the view, the controller, with some mocked data and model and view model, I could make this work for you.
That's disappointing that you can't easily use the MVC wrapper and still use knockout binding. I have this working now so I don't need any further assistance. Thanks for the help.
Hello Ryan,
Thank you for your cooperation!
I am glad that I have managed to help you.
good job !