DaveAlger
DaveAlger

Reputation: 2526

How to keep all items in an ExtJS treepanel visible at all times

I have a treepanel listing a complex hierachy of nodes.

If the list of nodes gets too big then the panel scrolls which is desired.

What is not desired is the ability of a user to click the arrow (or dblclick the item) to expand/collapse parent nodes.

What is the simplest way to ensure a treepanel always renders fully expanded and the expand/collapse functionality is removed?

Upvotes: 1

Views: 1224

Answers (1)

Alcides Queiroz
Alcides Queiroz

Reputation: 9576

I once needed to do this, and this solution(found here) worked for me:

For each uncollapsible node:

{text: 'Node', nodeType: 'node', expanded: true, cls: 'uncollapsible', collapsible: false}

In your CSS:

.uncollapsible .x-tree-elbow-minus {
    background-image: url(resources/images/default/tree/elbow.gif);
}

.uncollapsible .x-tree-elbow-end-minus {
    background-image: url(resources/images/default/tree/elbow-end.gif)
}

in your TreePanel:

listeners: {
    beforecollapsenode: function(node) {
        return node.attributes.collapsible;
    }
}

Upvotes: 2

Related Questions