mirror of
https://github.com/hanzoai/jube-fork.git
synced 2026-11-02 14:29:36 +00:00
55 lines
2.0 KiB
HTML
Executable File
55 lines
2.0 KiB
HTML
Executable File
<div data-model="mobileListViewModel" data-role="view" id="mobile-listview-events" data-title="ListView MVVM">
|
|
<form data-bind="events: { submit: add }">
|
|
<ul data-role="listview" data-style="inset" data-type="group">
|
|
<li>
|
|
Information
|
|
<ul data-role="listview">
|
|
<li>
|
|
Kendo UI Mobile ListView supports the
|
|
<a href="https://docs.telerik.com/kendo-ui/getting-started/framework/mvvm/bindings/source">source</a>,
|
|
<a href="https://docs.telerik.com/kendo-ui/getting-started/framework/mvvm/bindings/events">events</a> and
|
|
<a href="https://docs.telerik.com/kendo-ui/getting-started/framework/mvvm/bindings/visible">visible</a> bindings.
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
Add new item
|
|
<ul>
|
|
<li><label class="km-label-above">Item name <input type="text" placeholder="e.g. Chair" data-bind="value: newItemValue" /></label></li>
|
|
<li><i></i><button type="submit" class="km-justified km-widget km-button km-primary km-small">Add</button></li>
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
<li>
|
|
Items
|
|
<ul data-role="listview" data-bind="source: source, events { click: onClick }"></ul>
|
|
</li>
|
|
<li>
|
|
Events
|
|
</li>
|
|
</ul>
|
|
<div class="console"></div>
|
|
</form>
|
|
</div>
|
|
|
|
<script>
|
|
var mobileListViewModel = kendo.observable({
|
|
source: [ "Table", "Sofa" ],
|
|
newItemValue: "",
|
|
add: function(e) {
|
|
var val = this.get("newItemValue");
|
|
if (val) {
|
|
this.source.push(val);
|
|
}
|
|
|
|
$("#listview-new-item").blur();
|
|
e.preventDefault();
|
|
},
|
|
|
|
onClick: function(e) {
|
|
kendoConsole.log("event :: click (" + e.item.text() + ")", false, "#mobile-listview-events");
|
|
}
|
|
});
|
|
</script>
|