jQWidgets Forums

jQuery UI Widgets Forums Grid Grid updated value capture after a delete operation

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 12 years, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • himaja
    Member

    Hi,

    I am trying to capture the updated row indexes of the grid to an array on cellendedit event.
    And on save of the grid, I am reading the updated rows using the row index that i have captured.
    But when a delete happens before the updated data is saved, since the records are being deleted the row indexes are getting changed.
    When i use the updated row indexes to read the data, the data is coming for incorrect rows.

    Is there a way to handle this? Please suggest.

    Thanks


    Peter Stoev
    Keymaster

    You can use the updaterow callback function of the Grid’s source object. The function is called automatically by jqxGrid and is passed the updated rowID(s) and updated row(s).

          var source =
    {
    localdata: data,
    datatype: "local",
    addrow: function (rowid, rowdata, position, commit) {
    // synchronize with the server - send insert command
    // call commit with parameter true if the synchronization with the server is successful
    //and with parameter false if the synchronization failed.
    commit(true);
    },
    deleterow: function (rowid, commit) {
    // synchronize with the server - send delete command
    // call commit with parameter true if the synchronization with the server is successful
    //and with parameter false if the synchronization failed.
    commit(true);
    },
    updaterow: function (rowid, newdata, commit) {
    // synchronize with the server - send update command
    // call commit with parameter true if the synchronization with the server is successful
    // and with parameter false if the synchronization failed.
    commit(true);
    }
    };

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.