【发布时间】:2015-11-07 03:53:01
【问题描述】:
这里有示例代码,它以两种方式显示自动完成功能。
<div data-role="view" data-model="foo">
<div>
An autocomplete widget
<input data-role="autocomplete" data-source="['foo', 'bar', 'baz']" />
</div>
<div>
A widget bound to the mobile view ViewModel dataSource field
<input data-role="autocomplete" data-bind="source: dataSource" />
</div>
</div>
<script>
var foo = kendo.observable({
dataSource: ['foo', 'bar', 'baz']
});
new kendo.mobile.Application();
</script>
什么时候必须使用 observable,什么时候必须使用 DataSource?我不明白区别。
【问题讨论】:
标签: javascript templates data-binding kendo-ui telerik