Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
920
igGridUpdating
posted

Hi there,

I'm updating the grid row in javascript calling editRowEnding event with below piece of code, it works fine for first row but don't allow me to edit any other row in the grid. Please note that I don't want dataBind here and using latest release '12.2.20122.2176'

function editRowEnding(evt, ui) {
    if (ui.update) {
        var _templateID = ui.rowID;
        var _item = ui.values.CertItem;
        var _category = ui.values.Category
        var _values = ui.values.ItemValue;      

        var cols = {
            TemplateItemID: _templateID,
            CertItem: _item,
            Category: _category,
            ItemValue: _values
        };

        $("#GridTable").igGridUpdating("updateRow", _templateID, cols);
        $("#GridTable").igGrid("commit");
        $("#GridTable").igGrid("saveChanges");
    }

}

It always keep isEditing = true for:

var isEditing = $("#GridTable").igGridUpdating("isEditing");

Even try to endEdit with:

$("#GridTable").igGridUpdating("endEdit",true,evt);

But no luck!! Please advise any help.

Regards,

Jasdeep

Parents
  • 23953
    Verified Answer
    Offline posted

    Hello Jasdeep,

    In editRowEnding using the igGridUpdating.updateRow API will not work as it will not create a transaction (this is a design limitation), so calling igGrid.commit and igGrid.saveChanges will have no effect, because they are counting on the transaction log.
    As an alternative in igGridUpdating.editRowEnding event you can use the igGridUpdating.editorForKey API in order to get the cell editor and then use the igEditor API to update its value programmatically. This way the editor value will be propagated to a transaction which you can process (commit and save) in the igGridUpdating.editRowEnded event.
    Attached you can find a sample demonstrating this.

    Hope this helps,
    Martin Pavlov
    Infragistics, Inc.

    igGridUpdating_sample.zip
Reply Children