1. #1
    Sencha User
    Join Date
    Nov 2011
    Location
    León, Spain
    Posts
    77
    Answers
    2
    Vote Rating
    3
    diesalher is on a distinguished road

      0  

    Default 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.

    Code:
    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();
    and i get this warning

    [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?

  2. Ext.Viewport.add(picker) should get rid of that warning.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,620
    Answers
    3452
    Vote Rating
    817
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Ext.Viewport.add(picker) should get rid of that warning.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Nov 2011
    Location
    León, Spain
    Posts
    77
    Answers
    2
    Vote Rating
    3
    diesalher is on a distinguished road

      0  

    Default


    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

Thread Participants: 1