【发布时间】:2011-10-20 13:00:16
【问题描述】:
在我的应用程序中,我有一个列表。我想在点击一个项目时显示一个弹出(覆盖)。它适用于某些项目,但对于某些项目,叠加层会直接进入列表项。
注意:我想显示一个带有指向当前选定项目的箭头的叠加层。 这是我的代码:
var overlay = new Ext.Panel({
floating: true,
modal: true,
width: 100,
height: 100,
scroll: false});
var list = Ext.extend(Ext.List, {
store: myStore,
itemTpl: "{firstName} {lastName}",
listeners: {
itemtap: function (list, index, element, event) {
// Grab a reference the record.
var record = list.getRecord(element);
// First, we update the the overlay with the proper record (data binding).
overlay.update(record.data);
overlay.showBy(element, 'fade');
list.doComponentLayout();
}
}});
问题可能是我没有正确获取列表项。我只是在这里使用了当前元素。我也试过 list.getNode(index) 但它做同样的事情。谁能指导我正确的方向?
塔伦。
【问题讨论】:
标签: list sencha-touch extjs