Anand Singh
Anand Singh

Reputation: 327

How to set an item selected in extjs tree panel by default?

I have a tree panel with some items. Whenever I render the treepanel an item should be selected by default.

Upvotes: 2

Views: 10476

Answers (1)

Renganathan M G
Renganathan M G

Reputation: 5209

Please refer this code. This will work

Ext.each(Nodes, function(item, index, allNodes)
{
    var rec = TreePanelObj.getView().getRecord(item);
    if() //any condition 
    {
        TreePanelObj.getSelectionModel().select(index);
    }
});

Upvotes: 0

Related Questions