我已经实施了 Kendo ComboBox,但努力获得选定的价值....
$("#_FeeScheme_Input").kendoComboBox({
minLength: 1,
filter: 'contains',
dataTextField: "FeeSchemeDescription",
dataValueField: "FeeSchemeID",
select: onSelect,
dataSource: {
type: "json",
serverFiltering: false,
transport: {
read: "/Qualification/GetAllFeeScheme_JSON"
},
}
});
...
function onSelect(e) {
var dataItem = this.dataItem(e.item.index());
alert("value " + dataItem.text); //NOT WORKING... RETURN NULL VALUE
};
剃刀代码
<div class="form-group">
@Html.LabelFor(model => model._FeeScheme.FeeSchemeDescription, new { @class = "control-label col-md-3" })
<div class="col-md-6">
@Html.TextBoxFor(model => model._FeeScheme.FeeSchemeDescription, new { id = "_FeeScheme_Input" })
@Html.ValidationMessageFor(model => model._FeeScheme.FeeSchemeDescription)
</div>
</div>