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
Hierarchical Grid addRow & updateRow
posted

Hi there,

I've hierarchical grid with 2 child grids and I'm saving child row records while calling my web service from editRowEnding. All records are saving in DB and on web service callback in my javascript file I don't want to rebind the grid to show new records like $("#GridTable").igHierarchicalGrid("dataBind");

And I'm using addRow and updateRow from API to show and updated NEW row record. I'm also getting back all records of NEW row from web service. Below is my piece of code which is not working as expected and showing an error:

CODE:

var result = $.parseJSON(data.d);
    var cols = {
            UserID: result.UserID,
            UnitRightID: result.UnitRightID,
            UnitRef: result.UnitRef,
            UnitName: result.UnitName,
            AccessRights: result.AccessRights,
            SwitchUnit: result.SwitchUnit,
            Inactive: result.Inactive
        };

    if (SaveMode == 0) {
        $("#GridTable").igGridUpdating("addRow", cols);
    }
    else {
        $("#GridTable").igGridUpdating("updateRow", result.UnitRightID, cols);
    }
    
    $("#GridTable").igHierarchicalGrid("commit");
    $("#GridTable").igHierarchicalGrid("saveChanges");
   

ERROR:

Unhandled exception at line 51, column 16899 in http://localhost:58799/js/infragistics.js?Version=1.0.02
0x800a138f - JavaScript runtime error: Unable to set property 'UnitRightID' of undefined or null reference

Pls Note: I'm using latest release 12.2.20122.2127 and getting correct values in UNitRightID (Primary Key of child grid).

Please advise any help?

Regards,

Jasdeep