Sencha Touch itemtap

﹥>﹥吖頭↗ 提交于 2019-11-30 20:23:17
Stuart

The first argument passed to the itemtap event isn't the record of the List item tapped, it's the DataView itself.

From the docs:

itemtap : ( Ext.DataView this, Number index, Ext.Element item, Ext.EventObject e ) Fires when a node is tapped on

Listeners will be called with the following arguments:
this : Ext.DataView
    The DataView object
index : Number
    The index of the item that was tapped
item : Ext.Element
    The item element
e : Ext.EventObject
    The event object

You can grab the tapped record by using:

dataView.store.getAt(index); // where 'dataView' is 1st argument and 'index' the 2nd
Alex
itemtap: function(view, index, item, e) {
    var rec = view.getStore().getAt(index);
    ListDemo.detailPanel.update(rec.data);
}

That's how I got it to work.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!