1. #1
    Ext User
    Join Date
    Jul 2010
    Posts
    37
    Vote Rating
    0
    robertj98 is on a distinguished road

      0  

    Default undefined error in 0.97

    undefined error in 0.97


    I have a simple list screen which acts as a menu - calls card panels defined in the main layout, ie

    Code:
          var main = new Ext.Panel({
                fullscreen: true,
                layout: 'card',
                items:[menuPage, timeline, detail, items, item_detail,todo,years,searchPanel]
            }).show();
    Above this in the .js file is the code for menuPage which does main.setCard (<panel id>). In 0.96 this worked Ok, now in 0.97 the 'main' variable is coming up as undefined and the setcard fails.

    Code:
    var menuPage = new Ext.List({
                id: 'menuPage',
                dockedItems: [{
                              id: 'status',
                              xtype: 'toolbar',
                              dock: 'top',
                              title: "CollectGBStamps"
                             }
                           ],
                tpl: menuTemplate,
                itemSelector: 'div.menudetail',
                singleSelect: true,
                grouped: false,
                indexBar: false,
                emptyText   : '<p style="padding: 10px">No menu items found!</p>',
                store: menuStore,     
                listeners: {
                    itemtap: function(view, index, item, e){
                                var rec =  view.store.getAt(index);
                                var nextpanel = rec.get('optionPanel');
                                if (nextpanel == 'timeline') {
                                    timeline_title = "2010 Issues";
                                    Ext.getCmp('timeline_toolbar').setTitle ("2010 Issues");
                                    issuesStore.read({ params: { parm: '2010' }  });
                                    }
                                if (nextpanel == 'years') {
                                    yearsStore.read();
                                    yearsStore.sort('setyear' , 'DESC');
                                    }
                                if (nextpanel == 'searchPanel') {
                                    searchStore.read({ params: {  parm: 'bridge' }  });
                                    }
                                if (nextpanel == 'todo') {
                                    //alert(Ext.version);
                                    }
                               alert('going to ' + nextpanel);
                               console.log(main);
                               main.setCard(nextpanel);
                             }
                           }
            });
    Any ideas?

    Thanks
    Robert

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,800
    Vote Rating
    603
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Well, assuming
    a) That var main = ... is wrapped in an onReady block
    b) The second set of code is in another file

    I can see exactly why it would say main is not defined.

    Code:
    Ext.setup({
        onReady: function(){
            var x = 1; //local to the onReady scope
        }
    });
    Some other file:
    Code:
    setTimeout(function(){
        console.log(x); // undefined
    }, 1000);
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Ext User
    Join Date
    Jul 2010
    Posts
    37
    Vote Rating
    0
    robertj98 is on a distinguished road

      0  

    Default


    The code snippets in the examples are in the same file and are both within the onReady function.
    Switching to 0.96 libraries and this works OK.
    Once again moving to a new version of Sencha Touch breaks something that worked before - with no obvious reason for doing so that I can see. It is very frustrating.

    Robert

  4. #4
    Ext User
    Join Date
    Jul 2010
    Posts
    37
    Vote Rating
    0
    robertj98 is on a distinguished road

      0  

    Default


    Hi,

    This seems to work again if I remove the .show() call from the main card panel.

    Robert

Similar Threads

  1. about 'this.data is undefined' error
    By pirusira in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 3 May 2010, 12:19 AM
  2. Record is undefined error
    By ajanthanr in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 8 Jul 2009, 7:49 AM
  3. Error: combo is undefined
    By Rafael in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 18 Apr 2009, 9:53 AM
  4. weird error : sp is undefined
    By nbize in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 9 Mar 2009, 8:36 AM

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi