Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-2233
in
a recent build.
-
Sencha User
[RC1] Ext.dataview.List class onItemTrigger function has wrong signature
By inspecting the arguments array passed to this function, you can tell the
signature (parameter list) onItemTrigger: function(me, index, target, record, e) is not correct.
The code in Beta 3:
onItemTrigger: function(container, target, index, e)
is correct.
-
The onItemTrigger method is a listener of the itemtap event on the list. The arguments in the itemtap event have changed so the arguments in the onItemTrigger method are correct.
-
Sencha User
Problems with this thread
There are several reply to this thread which are deleted. The last replay I got is from
TommyMaintz has just replied to a thread you have subscribed to entitled - [CLOSED] [RC1] Ext.dataview.List class onItemTrigger function has wrong signature - in the Sencha Touch 2.x: Bugs forum of Sencha Forum.
This thread is located at:
http://www.sencha.com/forum/showthre...e&goto=newpost
Here is the message that has just been posted:
***************
This looks like it could be a bug. The fireEvent seems to not pass the record. We'll make sure to look into this and get back to you.
Thanks for the report.
-
The signature is correct for the current triggerEvent default. What triggerEvent are you using?
-
So my guess is you have a triggerEvent such as 'tap' or 'singletap'. The RC release changed this to 'itemtap', but it looks like the documentation wasn't updated. I also see we don't have an 'itemsingletap' event available for those that need it. So I have added 'itemsingletap' and updated the documentation to show that the valid options are 'itemtap', 'itemsingletap', 'itemdoubletap', 'itemswipe', and 'itemtaphold'.
-
Sencha User
I did not register any event handler other than the ones registered by the default List class.
I only know the onItemTrigger is invoked when I click on an item in the list.
This may be related to the thread
http://www.sencha.com/forum/showthre...787#post741787
Since I have to call this
me.container.on(me.getTriggerEvent(), me.onItemTrigger, me);
to get the onItemTrigger invoked when the list is clicked, my guess is that the event is fired by the container of the list instead of the list itselt, and the event signatures of two are different.
-

Originally Posted by
f_li
I did not register any event handler other than the ones registered by the default List class.
I only know the onItemTrigger is invoked when I click on an item in the list.
This may be related to the thread
http://www.sencha.com/forum/showthre...787#post741787
Since I have to call this
me.container.on(me.getTriggerEvent(), me.onItemTrigger, me);
to get the onItemTrigger invoked when the list is clicked, my guess is that the event is fired by the container of the list instead of the list itselt, and the event signatures of two are different.
Pretty sure it's the same issue. The author of that UX will need to update it.
-
Sencha User
I don't know what you mean by UX. The SidebarList is our class. It just extends the standard List class with some configuration. The code is shown in the other thread:
http://www.sencha.com/forum/showthre...787#post741787
-
Sencha User
In the GPL release sencha-touch-debug-all.js file
line 58546 (of class Ext.dataview.element.Container)
onItemTap: function(e) {
var me = this,
target = e.getTarget(),
index = me.getViewItems().indexOf(target);
me.fireEvent('itemtap', me, Ext.get(target), index, e);
},
line 58546 (of class Ext.dataview.element.Container)
The event is handled by the code at line 69591 (of class Ext.dataview.List)
onItemTrigger: function(me, index, target, record, e) {
if (!(this.getPreventSelectionOnDisclose() && Ext.fly(e.target).hasCls(this.getBaseCls() + '-disclosure'))) {
this.callParent(arguments);
}
},
You can see the 2 have different argument list - the position of target and index parameters are switched.
-
You are confusing the DataView's Container event with DataView's own event. The signature is correct for the scope it is running in (the DataView/List itself).