DropDownList Getting ClientSide Value on Selected Item in MVC

1 Answer 4209 Views
DropDownList
Ian
Top achievements
Rank 2
Ian asked on 23 Jul 2013, 09:29 PM
Currently to get the value of the selected item in the onSelect event I do this:

var onSelect = function (e) {
    var dataItem = this.dataItem(e.item.index());
    CCCOnline.changeAccount(dataItem.AccountNumberId);
};
$("#clientAcctsMenuKendo").data("kendoDropDownList").bind("select", onSelect);

My MVC DropDownList value data is bound to the "AccountNumberId" field.

Is this the proper way to do it, or is there an easier .GetValue() I can call the the "e" passed to onSelect perhaps?

1 Answer, 1 is accepted

Sort by
0
Accepted
Marco Antonio
Top achievements
Rank 1
answered on 24 Jul 2013, 01:36 AM
You can use $("#clientAcctsMenuKendo").data("kendoDropDownList").value(); to get the value.
Tags
DropDownList
Asked by
Ian
Top achievements
Rank 2
Answers by
Marco Antonio
Top achievements
Rank 1
Share this question
or