KendoUi学习之旅 Combobox的使用

<!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="width: 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>

 

posted @ 2017-08-31 09:44  jiangcm  阅读(884)  评论(0编辑  收藏  举报