Results 1 to 5 of 5

Thread: [SOLVED] TypeError: Result of expression 'config' [undefined] is not an object.

  1. #1
    Ext JS Premium Member
    Join Date
    Aug 2010
    Posts
    52
    Vote Rating
    2
      0  

    Exclamation [SOLVED] TypeError: Result of expression 'config' [undefined] is not an object.

    Hi folks,

    this is my first week workinf with the sencha touch framework and I am really tired of spending most of my hours with debugging... .

    I have a strange problem I can not reproduce..

    I used some parts of the kiva example to make a list that opens a sheet on selectchange with details.

    I get the following error when calling the superclass.initComponent in my below code:

    TypeError: Result of expression 'config' [undefined] is not an object. (sencha-touch-debug.js:614).


    PHP Code:
    app.views.purchaseOrders.Show Ext.extend(Ext.Sheet, {
        
    modal true,
        
    centered false,
        
    hideOnMaskTap true,

        
    cls 'purchaseOrderShow',
        
    layout 'fit',
        
    enter 'right',
        exit : 
    'right',
        
    width 400,
        
    stretchY true,

        
    initComponent : function () {
            
    Ext.apply(this, {
                
    items : {
                    
    xtype 'carousel',
                    
    items : [
                            
    this.getDetailsCard(),
                    ]
                },

                
    dockedItems : [
                        {
                            
    xtype 'button',
                            
    text 'Reject',
                            
    ui 'action',
                            
    dock 'bottom',
                            
    listeners : {
                                
    tap this.hideHandler
                            
    }
                        }, {
                            
    xtype 'button',
                            
    text 'Approve',
                            
    ui 'action',
                            
    dock 'bottom',
                            
    listeners : {
                                
    tap this.hideHandler
                            
    }
                        }
                ]
            });
            
    app.views.purchaseOrders.Show.superclass.initComponent.apply(thisarguments);
        },

        
    setPurchaseOrder : function ( purchaseOrder ) {
            
    this.instance purchaseOrder;

            if (
    this.rendered) {
                
    this.updateCards();
            } else {
                
    this.on('show'this.updateCardsthis);
            }
        },

        
    getDetailsCard : function () {
            return new 
    Ext.Component({
                
    tpl : new Ext.XTemplate('<h1>{description}</h1>''<p class="overview">''<strong>Status:</strong> {status}<br />''<strong>id:</strong> {id}<br />',
                        
    '<strong>Supplier:</strong> {supplier}<br />''<strong>SupplierNo.:</strong> {supplierNo}<br />''<strong>Created By:</strong>{createdby}<br />',
                        
    '<strong>Total Amount:</strong> ${totalAmount}''</p>', {
                            
    compiled true
                        
    }),
                
    itemId 'detailsCard',
                
    scroll 'vertical',
                
    styleHtmlContent true,
                
    html '',
                
    listeners : {
                    
    activate : function () {
                        if (
    this.scroller) {
                            
    this.scroller.scrollTo({
                                
    0,
                                
    0
                            
    });
                        }
                    }
                }
            });
        },
        
    /**
         * @private This is used internally by the component to update the contents
         *          of each card.
         */
        
    updateCards : function () {
            var 
    detailsCard this.down("#detailsCard"), purchaseOrder this.instance;

            
    detailsCard.update(purchaseOrder.data);
        }
    });

    Ext.reg('app.views.purchaseOrders.Show'app.views.purchaseOrders.Show); 
    I render that component from a controller show function:

    PHP Code:
    show : function(options) {
            
    console.log("purchaseOrders controller show: options:"options);
            var 
    view this.showView;

            if (!
    view) {
                
    this.showView this.render({
                    
    xtype 'app.views.purchaseOrders.Show'
                
    }, Ext.getBody());
                
    view this.showView;
            }
            
    view.setPurchaseOrder(options.instance);
            
    view.show();
        }, 
    All params, vars and arguments I send thru are valid. I debugged every little peace.


    Thanks a lot for your help!


    Flo
    Last edited by mikih; 14 Jan 2011 at 6:53 AM. Reason: solved

  2. #2
    Ext JS Premium Member
    Join Date
    Aug 2010
    Posts
    52
    Vote Rating
    2
      0  

    Default

    I found the issue!

    There is no hideHandler function anymore....

    PHP Code:
    dockedItems : [ 
                        { 
                            
    xtype 'button'
                            
    text 'Reject'
                            
    ui 'action'
                            
    dock 'bottom'
                            
    listeners : { 
                                
    tap this.hideHandler 
                            

                        }, { 
                            
    xtype 'button'
                            
    text 'Approve'
                            
    ui 'action'
                            
    dock 'bottom'
                            
    listeners : { 
                                
    tap this.hideHandler 
                            

                        } 
                ] 

    sorry guys, I am to much used to java or flex exceptions... that are much more supportive

  3. #3
    Sencha User tysoncadenhead's Avatar
    Join Date
    Jul 2009
    Location
    Nashville TN
    Posts
    16
    Vote Rating
    0
      0  

    Default

    I had this issue after switching from an earlier release. It turned out that it went away when I took out scroll: 'vertical' from my panel object. I'm guessing that has been deprecated.
    Tyson Cadenhead
    User Interface Developer
    http://tysonlloydcadenhead.com

  4. #4
    Sencha User
    Join Date
    Sep 2011
    Posts
    4
    Vote Rating
    0
      0  

    Question Result of expression 'c' [undefined] is not an object

    I'm getting similar error, even with the code that I have downloaded from the github repo for the example "Intro to the Nested List Component"
    TypeError: Result of expression 'c' [undefined] is not an object

  5. #5
    Sencha User
    Join Date
    Sep 2011
    Posts
    4
    Vote Rating
    0
      0  

    Default

    So I've kinda got a workaround:
    I define my json data as a variable , say "data" in the treestore component, and pass it as the value of parameter "root" ... so it looks like
    var data = {json};
    NestedListDemo.music_store = new Ext.data.TreeStore({ model: 'ListItem',
    root: data,
    proxy: {
    type: 'ajax',
    url: '/data/tracks.json',
    reader: {
    type: 'tree',
    root: 'items'
    }
    }
    });


Similar Threads

  1. Replies: 1
    Last Post: 18 Feb 2011, 10:29 AM
  2. Replies: 6
    Last Post: 2 Dec 2010, 7:32 AM
  3. Uncaught TypeError: Object #<an Object> has no method 'addEvents'
    By busybee in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 6 Oct 2010, 2:34 AM
  4. TypeError: Cannot read property 'parentNode' of undefined
    By zurdophp in forum Ext 3.x: Help & Discussion
    Replies: 1
    Last Post: 2 Sep 2010, 5:58 AM
  5. Replies: 1
    Last Post: 18 Jun 2010, 12:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •