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
65
igGridUpdating for child row of igHierarchicalGrid
posted

How do I refer to the row being updated in a hierarchical grid when the row is a child? I need to do this in order to change other cells in the row based upon a combo box selection. This is how I do it for the top level of an igGrid:

function vetlicensechanged(ui) {

var vetLicenseID = ui.items[0].data.VetLicenseID;
var vetLicense;

for (i = 0; i < vetLicensesJSON.length; i++) {
vetLicense = vetLicensesJSON[i];
if (vetLicense.vetLicenseID == vetLicenseID) {
break;
}
}

$("#dispatchgrid").igGridUpdating("editorForKey", "VetName").igTextEditor("value", vetLicense.vetName.trim());
$("#dispatchgrid").igGridUpdating("editorForKey", "VetLic").igTextEditor("value", vetLicense.vetLic.trim());
$("#dispatchgrid").igGridUpdating("editorForKey", "VetInformation").igTextEditor("value", vetLicense.vetInformation.trim());

}

But this technicque does not work when the combo box event fires from the child row.

How do I accomplish this?

Thanks,

-Chris

  • 65
    Offline posted

    OK, I figured this out.  I needed to iterate the child grid collection, looking specifically for the grid in editing mode.  From there I could access the grid's igUpdating object:

    function drugchanged(ui) {

    var childGrids = $('#dispatchgrid').igHierarchicalGrid('allChildren');

    var drugID = ui.items[0].data.DrugID;
    var drug;

    for (i = 0; i < drugsJSON.length; i++) {
    drug = drugsJSON[i];
    if (drug.drugID == drugID) {
    break;
    }
    }

    childGrids.each(function (index, grid) {
    if ($(grid).igGridUpdating('isEditing')) {
    $(grid).igGridUpdating('editorForKey', 'DrugName').igTextEditor('value', drug.productName.trim());
    }
    });

    }