PDA

View Full Version : Non-scrollable list inside scrolling container



ThiemNguyen
19 Sep 2013, 11:45 AM
Hi everyone,

I have read many related posts but not found any good answers yet although I know it's not a new question.

I would like to create a container which is scrollable and has a list and other components such as buttons or textfields which are arranged vertically. I don't want the list to be scrollable, it should just show all items.

I've been reading many posts and found some workarounds but they are not nice enough, for example I don't want to create a vbox with fixed flex config because it creates unnecessary spaces and also doesn't work with my idea that the list should not be scrollable itself. Or also setting directionLock on the list itself is not better, either, because it won't go across and hide other components as we scroll the outer container.

Is there any idea please?

Thanks,

Kurt001
23 Sep 2013, 2:32 AM
How about setting a value to list's itemHeight and then calc the height you need like this:

initialize: function() {
var itemHeight = this.getItemHeight();
var numberOfData = Ext.getStore('myDataStore').getData().getCount();
var list = Ext.Viewport.down('.list[itemId=myList]');
list.setHeight(numberOfData * itemHeight;);
}