I'm working on a Cordova hybrid app and currently facing issues on Windows 8.1 with Sencha Touch 2. I got a some divs on a listitem with some subelements. I defined a tap listener. This works fine with Android and IOS, but this doesn't work on Win8.1 with Internet Explorer. I'm always getting the above lying listitem-element not the clicked div-containers.
This is the simplified example:
view:
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 on tap listener always give me following:
<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>
I browsed alot through event, e, target but there is no reference to the clicked div container :/
Thanks in advance!
//edit: simplified example // it is related to grouped:true -> if i comment this out everything works as expected
fixed it - if grouped: true was set, it caused this unexpected results on IE.
Workaround: after showing view: list.updateGrouped()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With