【发布时间】:2018-04-16 18:02:48
【问题描述】:
我想在 extjs / sencha touch 的列表上方添加一个标题。
标题将是动态的,并且会根据页面而变化,因为它将包含页码和其他详细信息。因此,我已经修改了我的处理程序,它使用新结果更新列表,以便将结果列表添加到我的dealerList 卡中,它还添加了一个容器:
myapp.cards.dealerList.items.add(
new Ext.Container({
html: "Dealer results",
cls: "centered-title",
baseCls: "x-toolbar-title",
scroll: false,
layout: {
type: "hbox",
align: "stretch"
}
}),
new Ext.List({ ...
})
)
但是当我检查它时,只显示 ext.list,上面没有容器。注意,我不想要工具栏。 chrome也没有错误。
这是我的
dealerList卡片:
myapp.cards.dealerList = new Ext.Panel({
scroll: false,
layout: {
type: "vbox",
align: "stretch"
},
id: "dealer-list-results-card",
dockedItems: [myapp.toolbars.dealerList, myapp.toolbars.dealerListNav],
})
编辑 1: 以下是列表的主要配置参数:
{
flex: 1,
layout: {
type: "fit",
align: "stretch"
},
id: "results-list",
singleSelect: true,
scroll: "vertical",
}
编辑 2: 我发现了。如果我摆脱了列表,那么容器就会出现。在相关说明中,我似乎无法使用myapp.cards.dealerList.items.add() 显示多个项目,即使我调用该函数两次并且只使用一个参数加载它。
【问题讨论】:
标签: javascript extjs sencha-touch