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
100
After expanding hierarchical grid, child grid row selection not returning row data.
posted

Hi, 

i used below link to manually expand and collapse hierarchical grid rows.

https://ko.infragistics.com/community/forums/f/ignite-ui-for-javascript/tags/igHierarchicalGrid

after expand has done i am trying to select element from child grid as follow :

var childGrids = $(this.element).igHierarchicalGrid("allChildren");
$.each(childGrids, function (ix, grid) {
selRows = $(grid).igGridSelection("selectedRows");
//selRows = $(grid).igGrid("selectedRows");
});

it returns empty array. due to which i am not able to set value to any cell as well.

var rows = $(grid).igGridSelection("selectedRows");

$.each(rows, function (ix, row) {

// getting the child grid selected row cell data
var rowId = row.element.data("id");
var cellValue = $(grid).igGrid("getCellValue", rowId, "Mycol");

});

  • 29417
    Offline posted

    Hello Rupali , 

    Thank you for posting in our forum. 

    If you’re aiming to find the rows that were selected  in one of the child grids, then I suggest you check if the current child grid you’re looping through has selected rows and if does break the loop, for example:

     

    var selRows;

    var childGrids = $(this.element).igHierarchicalGrid("allChildren");
    $.each(childGrids, function (ix, grid) {
    selRows = $(grid).igGridSelection("selectedRows");

    if(selRows.length > 0){

    //breaks loop

    return false;

    }

    });

     

    Since the HierarchicalGrid does not allow different children to have selected rows only a single child grid can ever has selected rows at a time.

     

    Let me know if you have any questions .

     

    Best Regards,

    Maya Kirova

    Infragistics, Inc.

    http://ko.infragistics.com/support