Sencha touch 在Sencha中创建基本水平列表
我对Sencha touch相当陌生,发现很难创建一个水平列表。我可以通过传递一些内联数据成功地垂直创建列表,但似乎无法找到水平显示数据的方法。我尝试过在论坛中搜索,但似乎仍然无法解决问题。有人能帮我解决这个简单却让我很沮丧的问题吗 到目前为止,我的步骤是: 1创建一个数据模型Sencha touch 在Sencha中创建基本水平列表,sencha-touch,extjs,Sencha Touch,Extjs,我对Sencha touch相当陌生,发现很难创建一个水平列表。我可以通过传递一些内联数据成功地垂直创建列表,但似乎无法找到水平显示数据的方法。我尝试过在论坛中搜索,但似乎仍然无法解决问题。有人能帮我解决这个简单却让我很沮丧的问题吗 到目前为止,我的步骤是: 1创建一个数据模型 Ext.regModel('Alphabet', { fields: ['Letter'] }); 2//创建数据存储 App.ListStore = new Ext.data.Store(
Ext.regModel('Alphabet', {
fields: ['Letter']
});
2//创建数据存储
App.ListStore = new Ext.data.Store({
model: 'Alphabet',
data: [
{Letter: 'A'},
{Letter: 'b'},
{Letter: 'c'},
{Letter: 'd'},
{Letter: 'e'},
]
});
3创建列表
App.ListPanel = new Ext.List ({
store: App.ListStore,
itemTpl: '<div class = "Alphabet">{Letter}</div>'
});
5//对接面板至根面板
提前感谢将此添加到
App.ListContainer
scroll: {direction: 'horizontal',useIndicators: false}
更新:
尝试将其固定到根面板
App.ListPanel = new Ext.Toolbar ({
defaults:{ ui: 'plain'},
items: [
{text: 'ItemList_A'},
{text: 'ItemList_b'},
{text: 'ItemList_c'},
{text: 'ItemList_d'},
{text: 'ItemList_e'},
{text: 'ItemList_A'},
{text: 'ItemList_b'},
],
dock: 'bottom',
scroll: {
direction: 'horizontal',
useIndicators: false
},
layout: {
pack: 'center'
}
});
我的问题的解决方案是使用hbox布局将项目添加到新面板
我不认为EXT.LIST是为处理我的问题而设计的。感谢您的输入,但这并没有实现我的目标。此行使容器能够水平滚动。目前,我的数据以垂直方式显示。我需要以水平方式显示我的列表。这只会将项目添加到工具栏,不符合我的目的。我有一个将填充数据的列表,而且我还有按钮将数据添加到列表中
App.ListPanel = new Ext.Toolbar ({
defaults:{ ui: 'plain'},
items: [
{text: 'ItemList_A'},
{text: 'ItemList_b'},
{text: 'ItemList_c'},
{text: 'ItemList_d'},
{text: 'ItemList_e'},
{text: 'ItemList_A'},
{text: 'ItemList_b'},
],
dock: 'bottom',
scroll: {
direction: 'horizontal',
useIndicators: false
},
layout: {
pack: 'center'
}
});