-
21 Feb 2012 8:54 AM #1
Answered: How to avoid this warning in Picker ? (ST2 B3)
Answered: How to avoid this warning in Picker ? (ST2 B3)
Hi, im doing this to show a picker.
and i get this warningCode:var picker = Ext.create('Ext.Picker', { doneButton:'OK', cancelButton:'Cancelar', slots:[ { name:'rangoDesde', title:'Desde', data:[ {text:'07:00', value:'07:00'}, {text:'08:00', value:'08:00'}, {text:'09:00', value:'09:00'} ] }, { name:'rangoHasta', title:'Hasta', data:[ {text:'08:00', value:'08:00'}, {text:'09:00', value:'09:00'}, {text:'10:00', value:'10:00'} ] } ] }); Ext.Viewport.add(picker) picker.show();
[DEPRECATE][Ext.picker.Picker#show] Call show() on a component that doesn't currently belong to any container. Please add it to the the Viewport first, i.e: Ext.Viewport.add(component);
The problem is, when building my app for producion, this warning makes my app fail because
Uncaught TypeError: Cannot call method 'deprecate' of undefined (In Ext.log.Logger class)
So i need to get rid of the warning or include the logger in my all-classes.js.
I tried to do a Ext.require([...,...,,'Ext.log.Logger']) in my app.cs, but doesn't seem to help.
Any idea?
-
Best Answer Posted by mitchellsimoens
Ext.Viewport.add(picker) should get rid of that warning.
-
21 Feb 2012 9:47 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 434
- Answers
- 3102
Ext.Viewport.add(picker) should get rid of that warning.
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.
-
21 Feb 2012 10:36 AM #3
I have just that before picker.show() but doesnt seems to work
EDIT: My fault, it works, i had a controller with a lots of functions and i was testing against another picker. :S. Sorry for wasting your time


Reply With Quote