我正在开发一个Cordova混合应用程序,目前在Windows8.1上使用Sencha Touch 2,我得到了一些div和一些子元素。我定义了一个监听程序。这在Android和IOS上都很好,但在的Win8.1上却不起作用。我总是得到上面说谎的语言元素,而不是点击的div容器。
这是一个简化的例子:
意见:
Ext.define( 'App.view.MyDataView', {
xtype: 'mydataview',
extend: Ext.dataview.List ,
config: {
inline: false,
title: "myTitle",
scrollToTopOnRefresh: false,
cls: 'MyDataView',
itemCls: 'MyDataViewItem',
pressedCls: 'MyDataViewItemPressed',
grouped: true,
listeners: {
tap: {
element: 'element',
//delegate: '.something',
fn: function (e)
{
console.log(e.target.className)
}
}
},
deferEmptyText: false,
infinite: true,
variableHeights: true,
itemTpl: new Ext.XTemplate(
[
'<div class="red" style="background-color:red;width:50%">',
'red',
'<div class="black" style="background-color:black;width:80%">',
'<div class="blue" style="background-color:blue;width:30%">blue</div>',
'black</div>',
'</div>'
].join( '' ),
{
compiled: true,
getInteractable: function() {},
//some member functions here...
}
)
}
});
e.target的点击侦听器总是给我以下信息:
<div class="x-unsized x-list-item WorkingHoursDataViewItem x-has-height x-list-item-tpl" id="ext-simplelistitem-85" style="height: 42px !important; min-height: 42px !important; transform: translate3d(0px, 264px, 0px);">
<div class="x-unsized x-list-disclosure x-item-hidden" id="ext-component-233" style="display: none !important;"></div>
<div class="x-innerhtml" id="ext-element-815">
<div class="red" style="width: 50%; background-color: red;">
red
<div class="black" style="width: 80%; background-color:black;">
<div class="blue" style="width: 30%; background-color:blue;">
blue
</div>
</div>
black
</div>
</div>
</div>
</div>
</div>
</div>
</div>
我浏览了许多事件e,目标,但没有引用单击的div容器:/
提前感谢!
//编辑:简化示例//它与分组:true ->相关,如果我注释掉这一切都按预期工作
发布于 2015-07-21 11:19:53
修正了它-如果分组:真被设置,它会在IE上造成这个意想不到的结果。
解决办法:显示视图后: list.updateGrouped()
https://stackoverflow.com/questions/31405136
复制相似问题