-
14 Dec 2011 1:31 AM #1
setActiveItem is not a functiion
setActiveItem is not a functiion
REQUIRED INFORMATION
Ext version tested:- Sencha Touch 2.0PR3
- Safari 5
- Just copy-past the code from http://docs.sencha.com/touch/2-0/#!/api/Ext.tab.Panel, end have a js error:
- panel.getLayout().setActiveItem(1) is not a function
- no errors
Code:<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script src="sencha-touch-all-debug.js" type="text/javascript"></script> <link href="sencha-touch.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> Ext.application({ name: 'Sencha', launch: function() { var panel = Ext.create('Ext.Panel', { layout: 'card', items: [ { html: "First Item" }, { html: "Second Item" }, { html: "Third Item" }, { html: "Fourth Item" } ] }); panel.getLayout().setActiveItem(1); } }); </script> </head> <body></body> </html>
-
14 Dec 2011 6:37 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
remove the getLayout() part and just do it on the panel:
Code:panel.setActiveItem(1);
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.
Looks like we can't reproduce the issue or there's a problem in the test case provided.


Reply With Quote