kendoDropDownList使用经验
来源:互联网 发布:淘宝做一张海报多少钱 编辑:程序博客网 时间:2024/06/07 03:29
1. data-value-primitive 属性
<select data-value-field="id" data-text-field="name" data-bind="value: selectedProduct, source: products"></select><script>var viewModel = kendo.observable({ selectedProduct: null, products: [ { id: 1, name: "Coffee" }, { id: 2, name: "Tea" }, { id: 3, name: "Juice" } ]});viewModel.selectedProduct = viewModel.products[1];kendo.bind($("select"), viewModel);</script>
In this example the second option
will be selected after calling kendo.bind
. It's value
attribute is equal to the value of the id
field of theselectedProduct
. If the user selects another option the selectedProduct
will be set to the corresponding item from the products
array.
You can also use the value
binding with a View-Model field which is of primitive type.
<select data-role="dropdownlist" data-option-label="Select product..." data-value-primitive="true" data-value-field="id" data-text-field="name" data-bind="value: selectedProductId, source: products"></select><script>var viewModel = kendo.observable({ selectedProductId: null, products: [ { id: 1, name: "Coffee" }, { id: 2, name: "Tea" }, { id: 3, name: "Juice" } ]});kendo.bind($("select"), viewModel);</script>
By default the value binding for the select widgets(AutoComplete
, DropDownList
, ComboBox
, MultiSelect
) uses the selected item from the data to update the View-Model field when the initial value is null. The data-primitive-field
attribute can be used to specify that the View-Model field should be updated with the item value field instead.
- kendoDropDownList使用经验
- KendoUi中KendoDropDownList控件的使用——三级级联模块的实现
- 使用经验
- MRTG使用经验点滴
- ADO.Net 使用经验
- vim 使用经验
- WORD使用小经验
- vim 使用经验
- linux使用经验点滴
- Webwork2使用经验四则
- VMWare的使用经验
- VMWare的使用经验
- vim 使用经验(转)
- AspectJ使用经验
- TChart使用经验小结
- UrlReWriter 使用经验小结
- WindowsSocketAPI使用经验
- GridView控件使用经验
- TCP协议连接建立与连接断开过程
- XP安装LSD-FET430UIF仿真器驱动
- 文件下载
- me
- 2014年1月14日训练赛D题题解(栈+dfs)
- kendoDropDownList使用经验
- Android NDK
- CentOS更换网易源
- 文件读取
- 直接拿来用!10款实用Android UI工具
- SetConsoleScreenBufferSize
- C++ GUI Qt4编程-创建对话框
- webkit之page
- 优秀程序员无他-善假于物也