saravanan0905

Forum Replies Created

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • saravanan0905
    Participant

    The aim is to close an already expanded row when a new row expands.
    Step to reproduce the issue.
    Step1: Exapand any row.
    Step2: Now expand any other row, the value “id” from “subGridRowExpanded” event got the incorrect row id.

    var last_expanded_row_id;
    $("#grid").jqGrid({
    datatype: 'local',
    data: myGridData,
    colNames: ['Column 1', 'Column 2'],
    colModel: [
    { name: 'col1', width: 200 },
    { name: 'col2', width: 200 }
    ],
    ...
    subGrid: true,
    subGridBeforeExpand: function(pID, id) {
    if(last_expanded_row_id !== undefined) {
    $("#grid").collapseSubGridRow(last_expanded_row_id);
    }
    },
    subGridRowExpanded: function (pID, id) {
    //here id receives incorrect row id.
    $("#"+pID).html(pID+ "_t");
    $("#"+pID+"_t").jqGrid({
    datatype: 'local',
    data: mySubgrids[id],
    colNames: ['Col 1', 'Col 2', 'Col 3'],
    colModel: [
    { name: 'c1', width: 100 },
    { name: 'c2', width: 100 },
    { name: 'c3', width: 100 }
    ],
    ...
    });
    last_expanded_row_id = id;
    }
    });

     

Viewing 1 replies (of 1 total)

Stay connected with us in your favorite flavor!