Author Topic: UpdateList not updating the row  (Read 1822 times)

kshipra

  • Pro Enterprise
  • Jr. Member
  • *
  • Posts: 94
    • View Profile
UpdateList not updating the row
« on: November 09, 2017, 08:09:05 pm »
When user saves changes I want to updated the UpdatedAt date in rows.

I am sending new updatedAt values back in UpdateList, but the UpdatedAt column is not getting updated.

$.ajax({
                        dataType: "json",
                        type: "POST",
                        // async: true,
                        beforeSend: function (jqXHR, settings) {
                            //alert("saving...");
                            grid.showLoading();
                        },
                       
                        url: "../Home/BulkSave",
                        data: { changedData: JSON.stringify(changes), Id: Id},
                        success: function (response) {                         

                            var jsonRsp = response.data;
                       
                               console.log("--changes.addList--");
                               console.log(jsonRsp.addList);
                               console.log("--changes.updateList--");
                               console.log(jsonRsp.updateList);
                               console.log("--changes.deleteList--");
                               console.log(jsonRsp.deleteList);


                            grid.commit({ type: 'add', rows: jsonRsp.addList });
                            grid.commit({ type: 'update', rows: jsonRsp.updateList });
                            grid.commit({ type: 'delete', rows: jsonRsp.deleteList });


                             console.log("---reset---");
                             grid.history({ method: 'reset' });

.......
}


I see new updated value in UpdateList, but on commit shouldn't the rows be updated with these new values ?

For addList the Id is getting updated with new value from server automatically for add operations.
 

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Re: UpdateList not updating the row
« Reply #1 on: November 10, 2017, 11:05:58 am »
I see your point but documentation of commit method doesn't say that its's supposed to update other fields.

I would check its feasibility and add it in the future enhancement list.

Meanwhile you can do it manually by locating the matching rows (with same primary key ) and update the extra fields in rowData.