-
1 Sep 2011 5:40 AM #1
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. <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>
<br><br>When I use this with app.js like <br>Code: <script type="text/javascript" src="../../builds/ext-core.js"></script><br> <script type="text/javascript" src="../shared/examples.js"></script><br> <script type="text/javascript" src="classes.js"></script><br> <script type="text/javascript" src="portal.js"></script><br> <script type="text/javascript"><br> Ext.Loader.setPath('Ext.app', 'classes');<br><br> 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']);<br> Ext.onReady(function(){<br> Ext.create('Ext.app.Portal');<br> });<br> </script><br><br>it gives "namespace not defined" errors.<br><br>Please help me for the same.<br><br>Thanks & Regards.Code:Ext.application({<br> name: 'test',<br> autoCreateViewport: false,<br> <br> launch: function() {<br> <br> Ext.require([<br> 'Ext.layout.container.*','Ext.resizer.Splitter','Ext.fx.target.Element','Ext.fx.target.Component',<br> 'Ext.window.Window','Ext.app.Portlet','Ext.app.PortalColumn','Ext.app.PortalPanel',<br> 'Ext.app.PortalDropZone','Ext.app.GridPortlet','Ext.app.ChartPortlet'<br> ]);<br> <br> Ext.create('Ext.app.Portal');<br> }<br>});
-
Best Answer Posted by mitchellsimoens
You Ext.require statement should be before the Ext.application.
-
1 Sep 2011 5:47 AM #2
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
When I use this with app.js likeCode:<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>
it gives "namespace not defined" errors.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'); } });
Please help me for the same.
Thanks.
-
1 Sep 2011 9:57 AM #3Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
- Answers
- 3109
You Ext.require statement should be before the Ext.application.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
1 Sep 2011 10:40 PM #4


Reply With Quote