Datasource Update not triggering

2 posts, 0 answers
  1. Steve
    Steve avatar
    1888 posts
    Member since:
    Dec 2008

    Posted 04 Oct 2013 Link to this post

    This is my template:
    editTemplate: " <tr>\
                            <td class='name'>\
                                    <input type='text' value='#: PageName #' class='k-textbox small' />\
                            <td class='action'>\
                                <a href='\\#' class='icon icon-ok k-update-button' title='Save Changes'></a>\
                            <td class='action'>\
                                <a href='\\#' class='icon icon-remove k-cancel-button' title='Cancel'></a>\

    When I have firebug open and I click save changes (k-update-button) I get no ajax DS defines it, and the GET\DELETE work fine...any idea what it might be???

                dataSource: new{
                    transport: {
                        read: {
                            url: f.baseUrl + $medportal.User.UserName,
                            dataType: "json",
                            type: "GET"
                        update: {
                            url: f.baseUrl + "/Update",
                            dataType: "json",
                            type: "PUT"
                        destroy: {
                            url: function (data) {
                                var url = f.baseUrl + $medportal.User.UserName + "/" + data.FavouriteID;
                                return url;
                            dataType: "json",
                            type: "DELETE"
                    batch: false,
                    pageSize: 10,
                    schema: {
                        model: {
                            id: "FavouriteID",
                            fields: {
                                FavouriteID: { editable: false, nullable: true },
                                Index: { type: "number" },
                                PageName: { type: "string" },
                                Url: { type: "string" }
                template: kendo.template(f.rowTemplate),
                editTemplate: kendo.template(f.editTemplate),
                remove: function (e) {
                    var fav = e.model;
                    if (fav.FavouriteID === f.currentfavoriteid) {
                        //Reset the Add Button
  2. Alexander Popov
    Alexander Popov avatar
    1445 posts

    Posted 08 Oct 2013 Link to this post

    Hi Steve,

    This happens because the input element in the edit template is not bound to any of the model fields, so no changes in the model are detected even if you modify the textbox's value. You can bind the input to a filed using the following approach, as shown in the ListView Editing demo:  
    <input type="text" class="k-textbox" data-bind="value:PageName" name="PageName"/>

    You can find additional information on Value binding here.

    Alexander Popov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top