<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id="example">
<div class="demo-section k-content">
<div data-bind="invisible: isPrimitive">
<input data-role="combobox"
data-placeholder="请输入"
data-text-field="Item"
data-value-field="ID"
data-bind="value: selectedProduct,
source: products"
style=" 100%" />
</div>
</div>
<script>
var viewModel = kendo.observable({
selectedProduct: null,
isPrimitive: false,
isVisible: true,
isEnabled: true,
primitiveChanged: function() {
this.set("selectedProduct", null);
},
displaySelectedProduct: function() {
var selectedProduct = this.get("selectedProduct");
return kendo.stringify(selectedProduct, null, 4);
},
products: new kendo.data.DataSource({
transport: {
read: {
url: "/Home/GetCategoryList",
dataType: "json"
}
}
})
});
kendo.bind($("#example"), viewModel);
</script>
</div>
</body>
</html>