-
20 Feb 2012 11:08 AM #1
Unanswered: onclick in div tag doesn't work on Beta3 and mobile browsers works fine in Beta2
Unanswered: onclick in div tag doesn't work on Beta3 and mobile browsers works fine in Beta2
xtype : 'component',
styleHtmlContent : true,
cls : 'detail',
html : '<div onclick=alert("onClick");>OnClick</div>'
**This works fine on browsers.
When I click the text, OnClick I get the alert box however, if I view the application on iPhone nothing happens.
This worked with Beta 2 on both iPhone and desktop brwosers(chrome, safari)
Thanks,
Young,
-
20 Feb 2012 11:09 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
- Answers
- 3113
It would be better suited to add a tap listener in Sencha Touch.
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.
-
20 Feb 2012 11:28 AM #3
xtype : 'component',
id : 'MainAutoLoanButton',
// styleHtmlContent : true,
cls : 'detail',
listeners : {
tap : function () {
console.log('tapppp');
}
},
I thought tap listener is ONLY for 'button' type?
Above code doesn't work. but, if I change the 'component' to 'button' it works fine.
how come this worked fine with beta2 but, not beta3?
Thanks,
-
20 Feb 2012 11:30 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
- Answers
- 3113
You need the tap listener on the Ext.Element instance of that <div>
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.
-
20 Feb 2012 11:56 AM #5
tap listener is added to 'component' not the div tag.
Do you have any example of this?
Thanks,
-
20 Feb 2012 12:00 PM #6Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
- Answers
- 3113
Code:component.element.down('....').on('tap', function() {}, component);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.


Reply With Quote