PDA

View Full Version : How to scroll the list horizontal?



lansea
21 Jul 2010, 8:08 AM
I use the follow code set a horizontal scroll list


this.list = new Ext.List({
scroll: 'horizontal',
//minWidth: 9000,
layout: {
type: 'hbox'
padding: '5',
align: 'left'
}
});

this.main = new Ext.Panel({
scroll: 'horizontal'
layout:'fit',
defaults: {
scroll: 'horizontal'
},
items: this.list
});

this.items = [this.main];

when I load data to the list, the list can horizontal scroll, but only see first three data, the other data is cut. I debug the html, found that is because the width and min-width CSS properties is too small to display the data, so I set the list minWidth: to 9000, It can display all data,but that mean before I load data, I must calculate the data display length? Or there other good method to scroll list horizontal?

meyerovb
23 Jul 2010, 1:56 PM
scroll each element individually



Ext.setup({ onReady: function () {
var a = { scroll: 'horizontal',
html: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
};
new Ext.List({ fullscreen: true,
items: [a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a, a]
});
}});