Skip to content

Instantly share code, notes, and snippets.

@jbristowe
Created April 13, 2012 03:48
Show Gist options
  • Save jbristowe/2373527 to your computer and use it in GitHub Desktop.
Save jbristowe/2373527 to your computer and use it in GitHub Desktop.
ListView Event Handling for User Interactions
var listView = $("#listView").kendoListView({
dataSource: dataSource,
template: kendo.template($("#template").html()),
editTemplate: kendo.template($("#editTemplate").html())
}).delegate(".k-edit-button", "click", function(e) {
listView.edit($(this).closest(".product-view"));
e.preventDefault();
}).delegate(".k-delete-button", "click", function(e) {
listView.remove($(this).closest(".product-view"));
e.preventDefault();
}).delegate(".k-update-button", "click", function(e) {
listView.save();
e.preventDefault();
}).delegate(".k-cancel-button", "click", function(e) {
listView.cancel();
e.preventDefault();
}).data("kendoListView");
$(".k-add-button").click(function(e) {
listView.add();
e.preventDefault();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment