1. #1
    Sencha User
    Join Date
    May 2011
    Posts
    16
    Vote Rating
    1
    beerumrakesh is on a distinguished road

      0  

    Default Answered: [ExtJS 4] Portal Example with MVC

    Answered: [ExtJS 4] Portal Example with MVC


    Hi Guys, <br><br>I am trying to use the portal example in my application. When I use the way it is given in example it works fine.&nbsp; <br><br>But when I use this with app.js; it gives me "namespace is not defined" error. <br><br>Working fine with below mentioned way<br><br>JSP Page<br>
    Code:
    &nbsp;&lt;script type="text/javascript" src="../../builds/ext-core.js"&gt;&lt;/script&gt;<br>&nbsp;&nbsp;&nbsp; &lt;script type="text/javascript" src="../shared/examples.js"&gt;&lt;/script&gt;<br>&nbsp;&nbsp;&nbsp; &lt;script type="text/javascript" src="classes.js"&gt;&lt;/script&gt;<br>&nbsp;&nbsp;&nbsp; &lt;script type="text/javascript" src="portal.js"&gt;&lt;/script&gt;<br>&nbsp;&nbsp;&nbsp; &lt;script type="text/javascript"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ext.Loader.setPath('Ext.app', 'classes');<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ext.require(['Ext.layout.container.*', 'Ext.resizer.Splitter','Ext.fx.target.Element','Ext.fx.target.Component','Ext.window.Window',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Ext.app.Portlet','Ext.app.PortalColumn', 'Ext.app.PortalPanel', 'Ext.app.Portlet',&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Ext.app.PortalDropZone', 'Ext.app.GridPortlet','Ext.app.ChartPortlet']);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ext.onReady(function(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ext.create('Ext.app.Portal');<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; });<br>&nbsp;&nbsp;&nbsp; &lt;/script&gt;
    <br><br>When I use this with app.js like <br>
    Code:
    Ext.application({<br>&nbsp;&nbsp;&nbsp; name: 'test',<br>&nbsp;&nbsp; &nbsp;autoCreateViewport: false,<br>&nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp;&nbsp; launch: function() {<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Ext.require([<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Ext.layout.container.*','Ext.resizer.Splitter','Ext.fx.target.Element','Ext.fx.target.Component',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Ext.window.Window','Ext.app.Portlet','Ext.app.PortalColumn','Ext.app.PortalPanel',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'Ext.app.PortalDropZone','Ext.app.GridPortlet','Ext.app.ChartPortlet'<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;Ext.create('Ext.app.Portal');<br>&nbsp;&nbsp;&nbsp; }<br>});
    <br><br>it gives "namespace not defined" errors.<br><br>Please help me for the same.<br><br>Thanks &amp; Regards.

  2. You Ext.require statement should be before the Ext.application.

  3. #2
    Sencha User
    Join Date
    May 2011
    Posts
    16
    Vote Rating
    1
    beerumrakesh is on a distinguished road

      0  

    Default


    Hi Guys,

    I am trying to use the portal example in my application. When I use the way it is given in example it works fine.

    But when I use this with app.js; it gives me "namespace is not defined" error.

    Working fine with below mentioned way.
    JSP Page
    Code:
        <script type="text/javascript" src="../../builds/ext-core.js"></script>
        <script type="text/javascript" src="../shared/examples.js"></script>
        <script type="text/javascript" src="classes.js"></script>
        <script type="text/javascript" src="portal.js"></script>
        <script type="text/javascript">
            Ext.Loader.setPath('Ext.app', 'classes');
    
            Ext.require([
                'Ext.layout.container.*','Ext.resizer.Splitter','Ext.fx.target.Element','Ext.fx.target.Component',
                'Ext.window.Window','Ext.app.Portlet','Ext.app.PortalColumn','Ext.app.PortalPanel',
                'Ext.app.Portlet','Ext.app.PortalDropZone','Ext.app.GridPortlet','Ext.app.ChartPortlet'
            ]);
    
            Ext.onReady(function(){
                Ext.create('Ext.app.Portal');
            });
        </script>
    When I use this with app.js like

    Code:
    Ext.application({
        name: 'test',
        autoCreateViewport: false,
        
        launch: function() {
            
            Ext.require([
                'Ext.layout.container.*','Ext.resizer.Splitter','Ext.fx.target.Element','Ext.fx.target.Component',
                'Ext.window.Window','Ext.app.Portlet','Ext.app.PortalColumn','Ext.app.PortalPanel',
                'Ext.app.PortalDropZone','Ext.app.GridPortlet','Ext.app.ChartPortlet'
            ]);
           
            Ext.create('Ext.app.Portal');
        }
    });
    it gives "namespace not defined" errors.

    Please help me for the same.

    Thanks.

  4. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Answers
    3541
    Vote Rating
    847
    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


    You Ext.require statement should be before the Ext.application.
    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.

  5. #4
    Sencha User
    Join Date
    May 2011
    Posts
    16
    Vote Rating
    1
    beerumrakesh is on a distinguished road

      0  

    Default


    That really helped.

    Thanks a lot.

    Regards.

Thread Participants: 1