我有Kendo DropDown列表,我想选择DropDownList的选择值。我得到所选项目的文本,但不是应该是ID的值。如何在kendo UI中选择Dropdownlist值和文本MVC
function onSelect(e) {
var item = e.item;
var v = e.value;
var text = item.text();
alert(text);
alert(v);
};
绑定与DROPDOWNLIST数据剑道
$("#FirstName").kendoDropDownList({
dataTextField: "Fname",
dataValueField: "Id",
dataSource: dataSoucceAll,
});
与剑道下拉列表中选择绑定功能。
var dropdownlist = $("#FirstName").data("kendoDropDownList");
dropdownlist.bind("select", onSelect);
did you try item.value – Govind