how to collapseAllGroups in a subrgrid

Hi,

I have a subgrid constructed by full xml and the collapseAllGroups does not work. Sample code is below

    $fileXML = "
        <xml version='1.0' encoding='utf-8'>
            <rows>
                <head>
                    <column width='*' type='ro' align='left' sort='date'>To</column>
                    <column width='125' type='ro' align='left' sort='date'>Click Date</column>
                    <column width='90' type='ro' align='left' sort='str'>IP</column>
                    <afterInit>
                        <call command='groupBy'>
                            <param>0</param>
                        </call>
                        <call command='collapseAllGroups'></call>
                    </afterInit> 
                </head>  
    ";

I understand the collapseAllGroups does not work because it is supposed to call after data is loaded. Normally, I would do

grid.load('load_xml.php", function() {
    grid.groupBy(0);
    grid.collapseAllGroups();
}

how do I put the collapseAllGroups in “callback” after data loading using full XML technique. (e.g. dhtmlx.com/docs/products/doc … lGrid.html)

Thanks

grid.attachEvent("onSubGridCreated", function(sub){ sub.attachEvent("onXLE", function(){ //here you can place code //it will be called after subgrid loading }) });

thanks,

I have to place return true inside to make it works

grid.attachEvent("onSubGridCreated", function(sub){
        sub.attachEvent("onXLE", function(){
            sub.sub.collapseAllGroups();
        })
        return true;
});