【发布时间】:2012-02-15 13:33:46
【问题描述】:
我有一个列表,我正在使用一个停靠在顶部的工具栏。此列表还包含一个 indexBar。工具栏似乎将列表向下推。因此 indexBar 没有正确垂直对齐,当我向下滚动列表并到达最后一项时,它没有正确显示。有谁知道如何正确布局,以便工具栏不会将列表向下推?这是我的代码:
app.customerList = Ext.define('CustomerList', {
constructor: function() {
this.listComponent = Ext.create('Ext.List', {
itemTpl: '<div class="contact">{first_name} <strong>{last_name}</strong></div>',
store: customerListStore,
id: 'customer_list',
grouped: true,
indexBar: true,
listeners: {
itemtap: {
fn: function (list, index, item, evt) {
},
element: 'element'
}
}
});
this.listWrapper = Ext.create('Ext.Panel', {
fullscreen: true,
layout: 'fit',
items: [
{
xtype: 'toolbar',
docked: 'top',
title: 'Customers',
items: [
{
xtype: 'button',
text: 'Home',
ui: 'back',
listeners: {
tap: {
fn: function() {
},
element: 'element'
}
}
}
]
},
this.listComponent
]
});
}
});
如您所见,我正在从商店获取数据。我可以通过为列表提供底部的 css 规则来解决这个问题:38px,但我知道这是一个 hack,所以我宁愿不这样做。我看过名单上的煎茶视频,他们谈到了这个确切的困境。他们的解决方案是将列表放在包装器中,工具栏停靠在包装器中。所以我这样做了,但我仍然无法让它按应有的方式布局。
【问题讨论】:
标签: extjs sencha-touch-2