Results 1 to 6 of 6

Thread: Going Batty, what am I missing? 2 identical functions, 1 comes back undefined

  1. #1
    Sencha User
    Join Date
    Jan 2010
    Posts
    168

    Default Going Batty, what am I missing? 2 identical functions, 1 comes back undefined

    Going batty. Getting error "tallySummary" is undefined on Codeset #1

    Codeset #2 executes as expected.

    I know the grid xtype: transittallydetail exists because I use it just fine on another part of the application.

    Usually these things are typos with me, but I have looked at this so long I am batty. Please don't find a typo, I will shoot myself.

    Codeset #1 <-----Problem Code

    Code:
    ,buildDetailGrid : function() {
    
           return {
                 xtype     : 'transittallydetail'
                ,region    : 'south'
                ,itemId    : 'tallySummary'
                ,height    : 200
                ,flex      : 1
                ,loadMask  : true
                ,style     : 'background-color: #E8EDEA; padding: 10px'
            };
        }
        
        
        ,loadData : function(data) {
            STScls.form.DashTransitSummary.superclass.loadData.apply(this, arguments);
            this.loadDetailGrid();
        }
    
        ,loadDetailGrid : function(data) {
            if (this.data && this.data.container ) {
                
                this.getComponent('tallySummary').load({
                    params : {
                       container : this.data.container
                    }
                });
            }
            
        }
    Codeset #2 <------- Works as expected
    Code:
    ,buildDetailGrid : function() {
    
           return {
                 xtype     : 'podetailgridpanel'
                ,region    : 'south'
                ,itemId    : 'podetailGrid'
                ,height    : 200
                ,flex      : 1
                ,loadMask  : true
                ,style     : 'background-color: #E8EDEA; padding: 10px'
            };
        }
    
        ,loadData : function(data) {
            STScls.form.DashPOSummary.superclass.loadData.apply(this, arguments);
            this.loadDetailGrid();
        }
    
        ,loadDetailGrid : function(data) {
            console.log(data);
            if (this.data && this.data.poID ) {
                
                this.getComponent('podetailGrid').load({
                    params : {
                       poID : this.data.poID
                    }
                });
            }
            
        }

  2. #2
    Sencha User lsaffre's Avatar
    Join Date
    Aug 2009
    Location
    Estonia
    Posts
    34

    Default

    I'm happy I couldn't find any typo ;-) But what happens if you insert a line "console.log(this.items);" before the line "this.getComponent('tallySummary')"? Using FF or Chrome. Is the tallySummary grid one of the items?

  3. #3
    Sencha User
    Join Date
    Jan 2010
    Posts
    168

    Default Not sure

    Parsing the dom object stuff in debugging is my weakest part as I don't always know what I am looking for.

    Just for grins, I put the podetailgrid xtype into the transittally spot and have same result, so it has to be something in the current script and not the grd coming back as undefined.

    Finer tooth comb coming out.......

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,892

    Default

    Well of course what you posted is not the actual code, so nobody can debug.

  5. #5
    Sencha User
    Join Date
    Jan 2010
    Posts
    168

    Default True

    I am contemplating my next move. I don't want to waste too much forum time. Gonna sleep on it and look at it fresh tomorrow and post more code if necessary.

  6. #6
    Sencha User
    Join Date
    Jan 2010
    Posts
    168

    Default SOLVED: Sleeping on it works

    I was not calling the function properly to build the grid, so in essence a typo.

    ,initComponent : function() {
    this.items = [
    this.buildForm()
    ,this.buildDetailGrid()
    ];


    On the this.buildDetailGrid(), I forgot to put the ()

Similar Threads

  1. Javascript Functions in loaded HTML are undefined
    By Jonnsn in forum Ext 3.x: Help & Discussion
    Replies: 14
    Last Post: 15 Jul 2010, 10:59 AM
  2. 2 grids 2 identical functions -> Error on 1 grid removing data
    By Tumac in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 8 Apr 2010, 1:23 PM
  3. [ExtJS 2.x] Missing functions in CheckboxGroup class
    By Evolic in forum Community Discussion
    Replies: 6
    Last Post: 29 Jul 2009, 1:49 AM
  4. missing semicolons, undefined variables, etc...
    By matjaz in forum Ext 1.x: Bugs
    Replies: 1
    Last Post: 27 Jun 2007, 11:35 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
  •