List Sencha弹出列表项点击
在我的申请表中,我有一个清单。我想在点击某个项目时显示一个弹出窗口(覆盖)。它适用于某些项目,但对于某些项目,覆盖将直接指向列表项目 注意:我想显示一个箭头指向当前选定项目的覆盖图。 这是我的密码:List Sencha弹出列表项点击,list,sencha-touch,extjs,List,Sencha Touch,Extjs,在我的申请表中,我有一个清单。我想在点击某个项目时显示一个弹出窗口(覆盖)。它适用于某些项目,但对于某些项目,覆盖将直接指向列表项目 注意:我想显示一个箭头指向当前选定项目的覆盖图。 这是我的密码: var overlay = new Ext.Panel({ floating: true, modal: true, width: 100, height: 100, scroll: false}); var list = Ex
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),但它也做了同样的事情。有人能给我指引正确的方向吗
Tarun.只需将
false
添加到show by函数,即overlay.showBy(元素'fade',false)代码>
这是我的面板代码
var overlay = new Ext.Panel({
// We'll set the image src attribute's value programmatically.
//dock:'left',
floating: true,
modal: true,
width: 138,
height: 140,
scroll: false,
layout: {
type: 'vbox',
align:'center',
pack:'center'
},
//defaults:{flex:1},
items:[
{xtype: 'spacer'},
{
xtype: 'button',
ui:'action',
height:30,
width:103,
id: 'profileButton',
text: 'Profile'
},
{xtype: 'spacer'},
{
xtype: 'button',
ui:'action',
height:30,
width:103,
id: 'positionsButton',
text: 'Positions'
},
{xtype: 'spacer'},
{
xtype: 'button',
ui:'action',
height:30,
width:103,
id: 'actionButton',
text: 'Action'
},
{xtype: 'spacer'}
]});
哦我真傻。。谢谢llya。这个解决方案工作得很好,但是当我将面板扩展到vbox布局中的按钮时,显示的面板高度会随机降低。i、 e.对于某些项目,它显示完美,带有箭头面板和垂直堆叠的三个按钮,但对于某些项目,特别是列表底部的项目,面板高度降低??我无法识别这种随机行为。