This is a migrated thread and some comments may be shown as answers.

[Solved] Cascading Combo Box - Current value not loaded

2 Answers 150 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
jfkrueger
Top achievements
Rank 1
jfkrueger asked on 21 Jun 2012, 08:42 PM
I am using the "Cascading Combo Box" examples to help me to build a cascading combo box scenario with two combo boxes inside of an edit/add form for a grid. The add piece works great, but the edit piece does not filter the second combo box on the initial load. IE when the edit form loads, the first combobox should have the current value selected which should in turn cause the second combobox to go get it's contents based on the value of the first combobox. The second combobox is also not selecting the current value and I have to re-select every time I edit a record.

The controller method does get called (that loads the second select list) but the value of the first combobox that is being passed in is always the first item in the first list, regardless of whether or not that is the item that is actually selected. So even though the second item is selected in the first list, when the form loads the value of the first item gets passed to the controller method. And the current value is still not selected in the 2nd combo box (it is just blank).

Any insight?

Thanks!

2 Answers, 1 is accepted

Sort by
0
jfkrueger
Top achievements
Rank 1
answered on 21 Jun 2012, 08:57 PM
I believe I have it working now. I added the following to the grids onEdit event:

if (e.mode != "insert") {
    $("#DropDownList_Suppliers").trigger("valueChange");
}





0
Mi2
Top achievements
Rank 1
answered on 27 Sep 2012, 07:03 PM
Hi,

I have the same issue but in MVC, i have a two cascading dropdown box on a form edit, but the first control don“t show the item selected and the second never is trigered..

When the view charge all the info, both control's are show as empty.

Only when I clicking in the first dropdown box, the value saved before is showed as selected...

Tags
ComboBox
Asked by
jfkrueger
Top achievements
Rank 1
Answers by
jfkrueger
Top achievements
Rank 1
Mi2
Top achievements
Rank 1
Share this question
or