[英]sencha horizontal scroll with a list
我正在尝试遵循Sencha给出的列表水平示例。 我收到一条消息说(DataView的基本布局必须始终是Fit Layout)在示例中,它不是Fit布局。 有人可以告诉我我在这里缺少什么。 谢谢吉姆
Ext.define( 'Styles.view.Beginning', {
extend: 'Ext.List',
xtype: 'beginninglist',
config: {
title:'Beginning',
iconCls: 'star',
layout:{
type:'vbox',
pack: 'center'
},
items:[
{
//give it an xtype of list for the list component
xtype: 'dataview',
height: 250,
scrollable: 'horizontal',
directionLock: true,
inline: {
wrap: false
},
//set the itemtpl to show the fields for the store
itemTpl: '{name} {image}',
//bind the store to this list
store: 'Beginning'
}
]
}
});
首先,您需要学习Sencha布局。 你可以在这里参考。 您正在创建一个List
,然后尝试将Dataview
放入其中。 因此,如果您需要数据视图,请直接扩展数据视图,如下所示:
Ext.define('Styles.view.Beginning', {
extend: 'Ext.dataview.DataView',
xtype: 'beginninglist',
config: {
inline: {
wrap: false
},
scrollable: {
direction: 'horizontal'
},
//set the itemtpl to show the fields for the store
itemTpl: '{name} {image}',
//bind the store to this list
store: 'Beginning'
}
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.