1. #1
    Sencha User
    Join Date
    Aug 2012
    Posts
    27
    Vote Rating
    0
    chsrinivasgupta is on a distinguished road

      0  

    Default Unanswered: view is not defined error message

    Unanswered: view is not defined error message


    The below is my code. I am unable to create view it is giving error as view is not defined. pls give me
    solution. Thanks in advance.

    Code:
    Ext.define('Acsellerate.view.Main', {
        extend: 'Ext.navigation.View',
        alias: 'widget.main',
        config: {
            //useTitleForBackButtonText: true,
    
            defaultBackButtonText: '',
            navigationBar: {
                backButton: {
                    iconCls: 'reply',
                    iconMask: true
                },
                cls: 'title',
                layout: {
                    pack: 'center',
                    type: 'hbox'
    }
                },
                items: [{
                    title: 'First',
                    items: [{
                        xtype: 'button',
                        text: 'Push a new view!',
                        handler: function() {
                            //use the push() method to push another view. It works much like
                            //add() or setActiveItem(). it accepts a view instance, or you can give it
                            //a view config.
                            alert('hi');
                            view.push({
                                title: 'Second',
                                html: 'Second view!'
                            });
                        }
    }]
    }]
                    }
    
                });
    Last edited by jay@moduscreate.com; 18 Sep 2012 at 6:17 AM. Reason: NO [code][/code] tags in post

  2. #2
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,361
    Answers
    102
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    I modified your post. Please wrap your stuff with CODE tags in the future.

  3. #3
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,361
    Answers
    102
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    the "view" reference YOU are trying to access is not defined! you need to define it somehow.

    btn.getParent().push({ ... });

Thread Participants: 1