PDA

View Full Version : auto scroll in treepanel



y0uzha
10 Mar 2015, 12:53 AM
hi i have tree panel and i want to show an automatic scrollbar when my tree expanded. but why the scrollbar can't show in my tree panel. i've try to use properties autoScroll:true but it still the same. here is my code:



var treePanel = Ext.create('Ext.tree.TreePanel', {
id: 'tree',
//renderTo: "example-grid",
store: store,
flex:1,
autoScroll: true,
layout: 'anchor',
anchor: '100%',
width: '100%',
height:'100%',
collapsible: true,
collapseFirst: false
});


and here is my fiddle:
http://jsfiddle.net/y0uzha/yLy3nuxd/

fyi. i'm using extjs 4.2.1

yeghikyan
10 Mar 2015, 4:27 AM
Remove the "layout: 'anchor'," property and the scollbar will appear.

y0uzha
10 Mar 2015, 6:57 AM
hey it works. thank you so much for your help. :D

pc9692
4 Jan 2017, 10:23 PM
I am facing similar problems and even after applying the given solution, scroll bar doesnot appear.

var treePanel = Ext.create('Ext.tree.TreePanel', {

id: 'tree',
//renderTo: "example-grid",
store: store,
flex:1,
autoScroll: true,
//layout: 'anchor',
anchor: '100%',
width: '100%',
height:'100%',
collapsible: true,
collapseFirst: false
});


Ext.create('Ext.panel.Panel', {
width: 300,
height: 500,
renderTo: "example-grid",
items: [treePanel]
});




hi i have tree panel and i want to show an automatic scrollbar when my tree expanded. but why the scrollbar can't show in my tree panel. i've try to use properties autoScroll:true but it still the same. here is my code:



var treePanel = Ext.create('Ext.tree.TreePanel', {
id: 'tree',
//renderTo: "example-grid",
store: store,
flex:1,
autoScroll: true,
layout: 'anchor',
anchor: '100%',
width: '100%',
height:'100%',
collapsible: true,
collapseFirst: false
});


and here is my fiddle:
http://jsfiddle.net/y0uzha/yLy3nuxd/

fyi. i'm using extjs 4.2.1