-
6 Dec 2012 6:02 AM #1
Answered: Container on top of a list
Answered: Container on top of a list
Hi !
I'm using Sencha Architect and have just upgraded to ST 2.1.
What I want to do
Inside a fullscreen Panel, I want to add 2 containers on the top of a list and have the whole parent Panel vertically scrollable.
In ST 2.0.1 I managed to get this behavior by turning the list scrollable attribute to false and made the parent panel vertically scrollable.
It doesn't work anymore in ST 2.1 :-(
Is there a way to get this layout working ?
mockup.png
-
Best Answer Posted by hadukiCode:
Ext.create('Ext.List', { fullscreen: true, itemTpl: '{title}', items:[{ xtype:'container', scrollDock:'top', height:50, html:'another container' },{ xtype:'container', scrollDock:'top', height:100, html:'a container' }], data: [ { title: 'Item 1' }, { title: 'Item 2' }, { title: 'Item 3' }, { title: 'Item 4' } ] });
-
7 Dec 2012 1:05 AM #2
It looks like something's going wrong with the scrollable property of Ext.List and Ext.Dataview since the 2.1 in Architect, it's set to false by default, was true before the 2.1, and it often doesn't take effect when changing it, like if Architect doesn't see that I changed it.
-
7 Dec 2012 2:06 AM #3
Code:Ext.create('Ext.List', { fullscreen: true, itemTpl: '{title}', items:[{ xtype:'container', scrollDock:'top', height:50, html:'another container' },{ xtype:'container', scrollDock:'top', height:100, html:'a container' }], data: [ { title: 'Item 1' }, { title: 'Item 2' }, { title: 'Item 3' }, { title: 'Item 4' } ] });I write English by translator.
-
7 Dec 2012 4:04 AM #4
Hum, it looks like there is no way to add container to an Ext.List in Architect, am I wrong ?
Edit: I just tried adding items property to the list, and it works well :-o
I have 2 questions, first one, where did you found the scrollDock property ? Second one, what this property change ? I tried without, it looks the same.
But thank you, it really works as I what it to be
Edit2: I was trying scrollDock on a Dataview... It make a difference on List, perfect. Still have those two questions :
- Where is the scrollDock doc ?
- Why use a Dataview instead of a List ?
-
7 Dec 2012 11:36 AM #5
'scrollDock' only works for Ext.dataview.List, the default value is 'top'. you can try 'bottom' to find the difference.
'Ext.dataview.DataView' extends from 'Ext.Container'. You can add items like container but the items always on the top.
Everything on the source file.I write English by translator.
-
7 Dec 2012 3:02 PM #6
Amazing, it's working, so, thank you. But I just don't find scrollDock in the api, maybe I'm blind, or, as often, some elements are missing in the doc api :-(


Reply With Quote