Horizontal scrolling list

左心房为你撑大大i 提交于 2019-12-06 10:36:52

Did you try passing an object instead of just true for the 'inline' config:

var list = Ext.create('Ext.List',{
   store: store,
   itemTpl: new Ext.XTemplate('<img src="{icon}" />'),
   inline: { wrap: false },
   scrollable: {
     direction: 'horizontal',
     directionLock: true
   }
});

In the docs, they mention this avoids your wrapping problem and enables horizontal scrolling: http://docs.sencha.com/touch/2-0/#!/api/Ext.dataview.DataView-cfg-inline.

I did not try it though.

Hope this will work for you.

Ok, I finally found this working example which was quite helpful :

http://dev.sencha.com/deploy/touch/examples/production/list-horizontal/index.html

You can also find it in the examples/production/list-horizontal when you download Sencha Touch 2

It's not a really good idea (or might be impossible) to create a horizontal Ext.List

If you tends to produce something like "image slider" or "carousel", then it would be better if you create an Ext.Carousel or something that is more customizable, hbox. Ext.Carousel is easy and well-documented, so I will talk a little bit more about hbox.

The idea is, first you create an empty hbox with fixed height. Then, you can eventually add items to it. Each item is whatever you like, for example: Ext.Image in your case. Each of your hbox item is a component then you can easily customize it the way you want.

Hope this idea helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!