Results 1 to 4 of 4

Thread: [ExtJS 4] Portal Example with MVC

  1. #1
    Sencha User
    Join Date
    May 2011
    Posts
    16
    Vote Rating
    1
      0  

    Default 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
      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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    You Ext.require statement should be before the Ext.application.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  5. #4
    Sencha User
    Join Date
    May 2011
    Posts
    16
    Vote Rating
    1
      0  

    Default

    That really helped.

    Thanks a lot.

    Regards.

Posting Permissions

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