Hello,
I have a ListVIew binded to a DataSource which gets loaded as "json" datatype from a control ajax-wise.
The same control also expects POST request back to save/insert update data to DB.
I have kendoListVIew defined with some delegates, including:
var commentsList = $("#commentsList").kendoListView({
dataSource: commSrc,
editable: true,
template: kendo.template($("#ctemp").html()),
editTemplate: kendo.template($("#cedittemp").html())
}).delegate(".ledit-btn", "click", function(e) { commentsList.edit($(this).closest(".comment-view")); }).
delegate(".lsave-btn", "click", function(e) { commentsList.save(); }).
delegate(".lcancel-btn", "click", function(e) { commentsList.cancel(); }).data("kendoListView");
There is no e.preventDefault() - because they are DIVs, not hyperlinks.
I was under an impression that calling .save() on listView will cause DataSource to sync - which means it would call update routine defined under transport. But it never does anything actually.
I don't mind calling my own function and do my own ajax postback via delegate(".lsave-btn"), but then how do I pass data from form fields for edited item (or new item)?
Or am I missing something? PLease help :)
Thanks
I have a ListVIew binded to a DataSource which gets loaded as "json" datatype from a control ajax-wise.
The same control also expects POST request back to save/insert update data to DB.
I have kendoListVIew defined with some delegates, including:
var commentsList = $("#commentsList").kendoListView({
dataSource: commSrc,
editable: true,
template: kendo.template($("#ctemp").html()),
editTemplate: kendo.template($("#cedittemp").html())
}).delegate(".ledit-btn", "click", function(e) { commentsList.edit($(this).closest(".comment-view")); }).
delegate(".lsave-btn", "click", function(e) { commentsList.save(); }).
delegate(".lcancel-btn", "click", function(e) { commentsList.cancel(); }).data("kendoListView");
There is no e.preventDefault() - because they are DIVs, not hyperlinks.
I was under an impression that calling .save() on listView will cause DataSource to sync - which means it would call update routine defined under transport. But it never does anything actually.
I don't mind calling my own function and do my own ajax postback via delegate(".lsave-btn"), but then how do I pass data from form fields for edited item (or new item)?
Or am I missing something? PLease help :)
Thanks