Filter column type tree in DHTMLXGrid

Hi, I have a DHTMLXGrid attached to a window with a colType tree. It is working fine. Is there any easy way to filter data in the tree column based on text typed in a textbox? I appreciate any help. Thanks.

var strURL = 'ajaxpages/organizationxml.ajax?organizationId=' + orgID);    
var organizationWindow = new dhtmlXWindows();
organizationWindow.setSkin("dhx_skyblue");
organizationWindow.setImagePath('codebase/imgs/');
organizationWindow.enableAutoViewport(true);
var vwWin = organizationWindow.createWindow('organizations', 240, 30, 660, 500);    

vwWin.setText("Organization Selection Window");
organizationWindow.window('organizations').denyResize();
vwWin.button('minmax1').hide(); 

var organizationGrid = vwWin.attachGrid();
organizationGrid.setImagePath('codebase/imgs/');    
organizationGrid.enableDragAndDrop(false);
organizationGrid.setHeader("Organization, Type, Description");

organizationGrid.setColTypes("tree,ro,ro");
organizationGrid.setInitWidths("*,150,100"); 
organizationGrid.setColAlign("left,left,left");

organizationGrid.attachEvent('onRowSelect', function(id) 
    {
        
    });
organizationGrid.setSkin("dhx_skyblue");
organizationGrid.init();
organizationGrid.loadXML(strURL);

Have you tried to use filterBy() method? Please find tutorials here:
docs.dhtmlx.com/doku.php?id=dhtm … filterby&s[]=filterby
docs.dhtmlx.com/doku.php?id=dhtm … iltering&s[]=filterby
docs.dhtmlx.com/doku.php?id=dhtm … n_treegrid

Hi Olga,

I really appreciate your reply. How do I get the tree object that is placed inside the grid? This example seem to filter the tree inside the grid http://docs.dhtmlx.com/doku.php?id=dhtmlxgrid:api_method_dhtmlxgridobject_filterby&s. But now I need to expand and collapse the tree inside the grid. Thanks.

You can expand treeGrid node with openItem() method docs.dhtmlx.com/doku.php?id=dhtm … apsing_row

Hi Olga,

I hope I didn’t communicate my need clearly. It is not a DHTMLXTreeGrid I want to expand / collapse. It is a DHTMLXTree component placed inside a DHTMLXGrid (If you refer the code above, the first column type of the DHTMLXGrid is a DHTMLXTree). I need to get that DHTMLXTree object from the DHTMLXGrid and perform expand / collapse on it. Thanks.

Do you use “stree” eXcell type? Please check “stree” specific excell methods here docs.dhtmlx.com/doku.php?id=dhtm … ells#stree

Hi Olga,

Thanks for your reply. I am not using stree eXcell type. The methods for regular DHTMLX Grid and Treegrid seem to work fine for my needs.