the issue in sub gird when with the same json data

When i draw the sub grid ,then draw sub grid again.
it will draw a gird lost the sub, it seem some data will cache the grid data ,not draw again

when switch with different data , the grid not lost sub
var value = subRowCell.getValue(); the value is ‘’ " not a object.
somebody meet this issue?
code:

[code]drawGrid: function(rowsData) {
// this.hideLoadingMsg();
var self = this;
var viewType = this.viewType;
var $body = this.tableEl;
if(!rowsData){
rowsData = tableMockData[viewType];
}
var treeData = rowsData;
if (this.grid) {
this.grid.clearConfigCookie();
this.grid.clearAll();
this.grid.destructor();
this.grid = null;
$body.empty();
}
var mygrid = this.grid = new dhtmlXGridObject();

        mygrid.imgURL = dhtmlxLoader.getImgURL();
		mygrid.attachToObject($body.get(0));
        mygrid.setHeader(",strategyName");
        mygrid.setNoHeader(true);
        mygrid.setColTypes("sub_row_grid,ro");
        mygrid.setColAlign("left");
        var width = (viewType == 'snapshot')?18*100:16*100;
        mygrid.setInitWidths("30,"+width);
        mygrid.enableAutoHeight(true);
        mygrid.enableAutoWidth(true);
        mygrid.init();
        mygrid.setSkin("mr");
       
        mygrid.attachEvent("onSubGridCreated", function(subgrid, id, index, data) {
        	var config = self.getSubGridConfig();
			var cfgAttr = dhtmlxLoader.buildConfigArray(config);
			subgrid.setHeader(cfgAttr.name.join(","), null, cfgAttr.style);
			subgrid.setInitWidths(cfgAttr.width.join(","));
			subgrid.setColTypes(cfgAttr.type.join(","));
			subgrid.setColAlign(cfgAttr.align.join(","));
			subgrid.enableResizing(cfgAttr.resize.join(","));
			
            subgrid.enableAutoHeight(true);
            subgrid.enableAutoWidth(true);
            subgrid.init();
            GlobalizationUtil.setGridDateFormat(subgrid, "%Y-%m-%d");
			GlobalizationUtil.setGridNumberFormat(subgrid, cfgAttr.number, true);
            subgrid.callEvent("onGridReconstructed", []);
            subgrid.parse(data, "json");
            
            return false; // block default behavior
        });
        mygrid.attachEvent("onSubRowOpen", function(id, state) {
            var row = mygrid.getRowById(id);
            if (state) {
                row.className = "opened-row";
            } else {
                row.className = "closed-row";
            }
        });
        mygrid.parse(treeData, "json");
        this.openGridFirstItem();
    },
    openGridFirstItem: function() {
        var grid = this.grid;
        var firstRowId = grid.getRowId(0);
        var subRowColIndex = 0;
        var subRowCell = grid.cellById(firstRowId, subRowColIndex);
        if (subRowCell && subRowCell.open) {
            var value = subRowCell.getValue();
            if(value !== ""){
                subRowCell.open();
            }
        }
    }[/code]

data:{ "rows": [{ "id": "STUSA04BFW", "data": [{ "value": { "id": null, "data": null, "rows": [{ "id": "F000002H3R", "data": ["Schroder BRICs Feeder Equity A", "Open-End Fund", "KOR", "55.1", "55.2", "55.3", "55.4", "55.5", "55.6", "55.7", "55.8", "55.9", "55.11", "STUSA057FF", "FSUSA09N66", "F000002H3R"], "rows": null, "class": "mr-subgrid-row", "style": null }, { "id": "F00000M826", "data": ["Schroder BRICs RP Balanced Fdr Bd Bal E", "Open-End Fund", "KOR", "55.1", "55.2", "55.3", "55.4", "55.5", "55.6", "55.7", "55.8", "55.9", "55.11", "STUSA057FF", "FSUSA0BCEV", "F00000M826"], "rows": null, "class": "mr-subgrid-row", "style": null }, { "id": "F000002H49", "data": ["Schroder BRICs Balanced Feeder Bd Bal A", "Open-End Fund", "KOR", "55.1", "55.2", "55.3", "55.4", "55.5", "55.6", "55.7", "55.8", "55.9", "55.11", "STUSA057FF", "FSUSA09N64", "F000002H49"], "rows": null, "class": "mr-subgrid-row", "style": null }], "class": null, "style": null }, "type": "sub_row_grid", "class": null, "style": null }, "AllianceBernstein Global Real Estate"], "rows": null, "class": "mr-grid-row", "style": null }, { "id": "STUSA054Y4", "data": [{ "value": { "id": null, "data": null, "rows": [{ "id": "F000002H5Z", "data": ["Schroder BRICs Feeder Equity E1", "Open-End Fund", "KOR", "55.1", "55.2", "55.3", "55.4", "55.5", "55.6", "55.7", "55.8", "55.9", "55.11", "STUSA057FF", "FSUSA09N65", "F000002H5Z"], "rows": null, "class": "mr-subgrid-row", "style": null }], "class": null, "style": null }, "type": "sub_row_grid", "class": null, "style": null }, "Federated National Tax-Free Money Market"], "rows": null, "class": "mr-grid-row", "style": null }] }



The subgrid is designed to render only once, on first opening, when you are closing and opening that cell again - it will not trigger the same rendering logic. It will reuse previously created grid.

If you need to reload data in some sub-grid, it can be done as

grid.cells(i,j).getSubGrid().clearAll();
grid.cells(i,j).getSubGrid().load(url);

thank you for you reply,
according to you code, it still cannot solve it.
but follow you idea ,i thought other similar way to solve it ,it now work well now.
My idea is set sub gird node data again when lost the sub gird data.
var data = xxxx;
subRowCell.setValue(data );
Although this can be solved, but still don’t know the root cause of it。
Hope I have a better solution。

openGridFirstItem: function() { var grid = this.grid; var firstRowId = grid.getRowId(0); var subRowCell = grid.cells(firstRowId, 0); var subgrid = subRowCell.getSubGrid(); if (subRowCell && subRowCell.open) { var value = subRowCell.getValue(); if(value == ''){ var data = {"id":xx,"data":yy,"rows":[{"id":"F000002H3R","data"...}; subRowCell.setValue(data ); } subRowCell.open(); } },