-
23 Feb 2012 12:58 PM #1
[RC1] Ext.dataview.List class onItemTrigger function has wrong signature
[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.
-
23 Feb 2012 1:03 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,582
- Vote Rating
- 433
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.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
23 Feb 2012 2:11 PM #3
Problems with this thread
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.
-
24 Feb 2012 9:08 AM #4Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,651
- Vote Rating
- 14
The signature is correct for the current triggerEvent default. What triggerEvent are you using?
-
24 Feb 2012 9:33 AM #5Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,651
- Vote Rating
- 14
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'.
-
24 Feb 2012 11:30 AM #6
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.
-
24 Feb 2012 11:46 AM #7Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,651
- Vote Rating
- 14
-
24 Feb 2012 12:29 PM #8
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
-
9 Apr 2012 1:26 PM #9
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.
-
9 Apr 2012 2:17 PM #10Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,651
- Vote Rating
- 14
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).
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-2233
in
2.0.


Reply With Quote