-
19 Feb 2012 3:11 PM #1
Unanswered: itemtap not being triggered
Unanswered: itemtap not being triggered
itemtap is not being called.
any idea what is wrong.
onTap function is not being called.
thanks. i 've tried many things.
Code:Ext.define('pn.app.myList', { extend: 'Ext.List', config: { itemTpl: '{item}', onItemDisclosure: true, store: Ext.create('Ext.data.Store', { model: 'saItems', data: [ {item:'one'}, {item:'two'} ] }) }, initialize: function() { this.callParent(); this.on('itemtap', this.onTap, this); }, onTap: function(dv,index, item, rec, e) { alert(123); } }); Ext.define('pn.app.homePanel', { extend: 'Ext.Panel', config: { layout:'fit', items: [ Ext.create('pn.app.myList'), { xtype:'toolbar', docked: 'top', items:[ {text: 'Home', handler: function() { alert(1);}}, {xtype: 'spacer'}, {text:'About', handler: function() {alert(2); }} ] } ] } }); pn.app.homePanel = Ext.create('pn.app.homePanel'); Ext.Viewport.add([ pn.app.homePanel ]);
-
19 Feb 2012 5:17 PM #2
less info
less info
Code:just removed most of the codebut should this work?Ext.define('pn.app.myList', { extend: 'Ext.List', config: { itemTpl: '{item}', onItemDisclosure: true, store: Ext.create('Ext.data.Store', { model: 'saItems', data: [ {item:'one'}, {item:'two'} ] }) }, initialize: function() { this.callParent(); this.on('itemtap', this.onTap, this); }, onTap: function(dv,index, item, rec, e) { alert(123); } });
-
19 Feb 2012 10:20 PM #3
found it but
found it but
change from this
to this (using xtype instead of ext.create). any thoughts?Code:Ext.define('pn.app.homePanel', { extend: 'Ext.Panel', config: { layout:'fit', items: [ Ext.create('mylist'), { xtype:'toolbar', docked: 'top', items:[ {text: 'Home', handler: function() { alert(1);}}, {xtype: 'spacer'}, {text:'About', handler: function() {pn.app.aboutPanel.show(); }} ] } ] } });
Code:Ext.define('pn.app.homePanel', { extend: 'Ext.Panel', config: { layout:'fit', items: [ {xtype:'mylist'}, { xtype:'toolbar', docked: 'top', items:[ {text: 'Home', handler: function() { alert(1);}}, {xtype: 'spacer'}, {text:'About', handler: function() {pn.app.aboutPanel.show(); }} ] } ] } });
-
20 Feb 2012 2:01 AM #4
have you tried the
itemTap listenerinstead ofonTap?
-
20 Feb 2012 6:40 PM #5
continueing
continueing
hi,
onTap is my local function that is attached via the 'on' method.
So it seems that other folks have observed similar
http://stackoverflow.com/questions/8...sencha-touch-2
if i added the Ext.create it shows but tapping does not work, but it works if i add the xtype for lazy loading.
am I missing something fundamental that changed with ST 2 that worked fine with ST 1.
I used to do create of most panels before setup.onready, now, i converted most to ext.define. and try to create the panel only inside the onready. but 1) is this really necessary(makes me do classes for one of), 2) still not working a) events are not triggered..(in the example i have to use lazy loading now).. .


Reply With Quote