PDA

View Full Version : Can't find variable: Ext



NKrishnawat
12 Oct 2012, 10:22 AM
I am trying to create single js file of entire app, I downloaded SenchaCmd-3.0.0.190-windows and used sencha sdk command and got following response:

C:\Documents and Settings\nkrishnawat>sencha create jsb -a C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.23\webapp
s\wam-bpm-ext\index.html -p wam-bpm-ext.jsb
[ERROR] Ext is not defined, please verify that the library is loaded properly on the application's page
undefined:0 ReferenceError: Can't find variable: Ext

I am using Extjs4.1.1-GA, Here is my index.html file.


<!DOCTYPE html>

<html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="shortcut icon" href="/icons/favicon.ico" type="image/x-icon" /> <title>Account Transitions</title> <!-- link href="/teamworks/html/common/ext-4.1.1-gpl/examples/ux/css/MultiSelect.css" type="text/css" rel="stylesheet"--> <link rel="stylesheet" type="text/css" href="css/bpm-ext-style.css"/> <link rel="stylesheet" type="text/css" href="ext-4.1.1-gpl/resources/css/ext-all.css"/> <link rel="stylesheet" type="text/css" href="style.css"/> <link rel="stylesheet" type="text/css" href="ux/css/BoxSelect.css" /> <!-- link rel="stylesheet" type="text/css" href="/ext-4.1.1-gpl/ext3-compat.css" /--> <link rel="stylesheet" type="text/css" href="ux/css/ItemSelector.css" /> <!-- link rel="stylesheet" type="text/css" href="/ext-4.1.1-gpl/examples/ux/grid/css/example.css" /--> <!-- For Print functionality --> <link rel="stylesheet" type="text/css" href="ux/css/CheckHeader.css"> <!-- Ext JavaScript --> <script type="text/javascript" src="ext-4.1.1-gpl/ext-all-debug.js"></script> <!--script type="text/javascript" src="/ext-4.1.1-gpl/ext3-core-compat.js"></script> <script type="text/javascript" src="/ext-4.1.1-gpl/ext3-compat.js"></script--> <script type="text/javascript" src="ux/swfobject/swfobject.js"></script> <script type="text/javascript" src="ux/exporter/downloadify.min.js"></script> <script type="text/javascript" src="Common-util.js"></script> <!-- Why did this not go in a file ? TODO: Revisit this.--> <script type="text/javascript"> Ext.Loader.setConfig({enabled: true}); Ext.Loader.setPath('Ext.ux', 'ux'); Ext.require([ 'Ext.form.Panel', 'Ext.ux.form.MultiSelect', 'Ext.ux.form.ItemSelector', 'Ext.ux.grid.Printer', 'Ext.ux.exporter.Exporter', 'Ext.ux.CheckColumn' ]); </script> <script type="text/javascript" src="data/UrlParam.js"></script> <!-- <script type="text/javascript" src="ux/form/MultiSelect.js"></script> <script type="text/javascript" src="ux/form/ItemSelector.js"></script> --> <!-- Ext external components JavaScript --> <script type="text/javascript" src="ux/miframe/ManagedIframe.js"></script> <script type="text/javascript" src="ux/src/BoxSelect.js"></script> <!-- Application specific JavaScript --> <!-- script type="text/javascript" src="/teamworks/html/coaches/common/script/data.js"></script--> <script type="text/javascript" src="coach20.js"></script> <script type="text/javascript" src="global.js"></script> <script type="text/javascript" src="Application.js"></script> <script type="text/javascript" src="sharepoint.js"></script></head><body> <div id="loading"> <div id="loadingMessage" class="loading-indicator">Loading...</div> </div> <div id="renderhere"></div> <div id="itemselector" class="demo-ct"></div></body> </html>


Though I am able to run the application from browser fine, Why I am getting "Can't find variable: Ext".

-Thanks

dongryphon
12 Oct 2012, 11:35 PM
Can you post a clean copy of the markup and the exact command(s) you ran?

NKrishnawat
15 Oct 2012, 8:45 AM
I used only one command:

sencha create jsb -a C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.23\webapp
s\wam-bpm-ext\index.html -p wam-bpm-ext.jsb

I used code block and placed html. not sure why it did not format properly. Let me try one more time after removing comments:


<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/icons/favicon.ico" type="image/x-icon" />
<title>Account Transitions</title>
<link rel="stylesheet" type="text/css" href="css/bpm-ext-style.css"/>
<link rel="stylesheet" type="text/css" href="ext-4.1.1-gpl/resources/css/ext-all.css"/>
<link rel="stylesheet" type="text/css" href="style.css"/>
<link rel="stylesheet" type="text/css" href="ux/css/BoxSelect.css" />
<link rel="stylesheet" type="text/css" href="ux/css/ItemSelector.css" />
<link rel="stylesheet" type="text/css" href="ux/css/CheckHeader.css">
<script type="text/javascript" src="ext-4.1.1-gpl/ext-all-debug.js"></script>
<script type="text/javascript" src="/ext-4.1.1-gpl/ext3-compat.js"></script-->
<script type="text/javascript" src="ux/swfobject/swfobject.js"></script>
<script type="text/javascript" src="ux/exporter/downloadify.min.js"></script>
<script type="text/javascript" src="Common-util.js"></script>
<script type="text/javascript">
Ext.Loader.setConfig({enabled: true});
Ext.Loader.setPath('Ext.ux', 'ux');
Ext.require([
'Ext.form.Panel',
'Ext.ux.form.MultiSelect',
'Ext.ux.form.ItemSelector',
'Ext.ux.grid.Printer',
'Ext.ux.exporter.Exporter',
'Ext.ux.CheckColumn'
]);
</script>
<script type="text/javascript" src="data/UrlParam.js"></script>
<script type="text/javascript" src="ux/miframe/ManagedIframe.js"></script>
<script type="text/javascript" src="ux/src/BoxSelect.js"></script>
<script type="text/javascript" src="coach20.js"></script>
<script type="text/javascript" src="global.js"></script>
<script type="text/javascript" src="Application.js"></script>
<script type="text/javascript" src="sharepoint.js"></script>
</head>
<body>
<div id="loading">
<div id="loadingMessage" class="loading-indicator">Loading...</div>
</div>
<div id="renderhere"></div>
<div id="itemselector" class="demo-ct"></div>
</body>

</html>

accguy
15 Oct 2012, 9:21 AM
I am pretty new to sencha cmd, but, does sencha know where to find your ExtJS SDK?

I had to tell sencha where it was, like:



sencha -sdk /path/to/extjs ...


Notice, use of Single and not double dash...

NKrishnawat
15 Oct 2012, 9:59 AM
Thanks, it worked but now I ran into another error: this.get is not a function

Command I ran :


C:\Documents and Settings\nkrishnawat>sencha create jsb -sdk C:\software\ext-4.1.1-gpl\extjs-4.1.1 -a C:\Program Files\Apache Soft
ware Foundation\apache-tomcat-7.0.23\webapps\wam-bpm-ext\index.html -p wam-bpm-ext.jsb -verbose


Response:

C:\Program Files\SenchaSDKTools-1.2.3\command\\src\CliOptions.js:127 TypeError: this.get is not a function
Execution error in C:\Program Files\SenchaSDKTools-1.2.3\command\sencha.js.

dongryphon
15 Oct 2012, 10:26 AM
Looks like the "sencha" command is not picking up the right Sencha Cmd. Check your PATH to ensure you have the right version there.

NKrishnawat
15 Oct 2012, 10:52 AM
I changed sdk to latest one (3.0.0.190) but looks like new sencha command has changed options, Its not able to understand create, jsb, sdk or -s.
I want to minify entire application to single file for production use. Which command should I use.

NKrishnawat
15 Oct 2012, 2:59 PM
I used sencha create after following this:
(http://www.redfin.com/CA/San-Fernando/10837-White-Oak-Ave-91344/home/5785502)http://docs.sencha.com/ext-js/4-1/#!/guide/command_app_single

but command does not identify -yui option. How to create single page app.

dongryphon
15 Oct 2012, 6:52 PM
There is a related guide here: http://docs.sencha.com/ext-js/4-1/#!/guide/command_app

The new compiler in Sencha Cmd v3 does not generate JSB files nor does it need them. There is support for building from a JSB but that is for folks that have processes built around JSB and cannot move to the new model right away.

The simplest approach is to use the "sencha compile page ..." command but it really helps to set up the ".sencha" folder first so you can use the "sencha.cfg" file to configure your classpath.

You can do that by following the guides to create a dummy application and copy the ".sencha" folder in to your app. This will not necessarily allow the "sencha generate" or other high-level commands to work ... at least not unless you follow the same structure we generate for apps. But this will be sufficient to streamline your "sencha compile page" command.

NKrishnawat
16 Oct 2012, 8:21 PM
Thanks for response, I changed to 4.1.1a, but when I run the command to create single js app (minified app) I get following exception:


C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.23\webapps\wam-bpm-ext>C:\software\Sencha\Cmd\3.0.0.190\sencha compi
le -classpath=extjs/src,app,. page -yui -in index.html -out build/index.html
Sencha Cmd v3.0.0.190
[INFO ] Compiling page null
[INFO ] Processing classPath entry : C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.23\webapps\wam-bpm-ext\
sencha-compile-temp-dir
[INFO ] Processing classPath entry : extjs\src
[INFO ] Processing classPath entry : app
[INFO ] Processing classPath entry : .
[INFO ] Processing classPath entry : C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.23\webapps\wam-bpm-ext\
app
[INFO ] Processing class inheritance graph
[INFO ] Processing instantiation refereces to classes and aliases
[INFO ] Processing source dependencies
[ERROR] Circular requires reference :
C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.23\webapps\wam-bpm-ext\extjs\src\AbstractComponent.js ->
C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.23\webapps\wam-bpm-ext\.\extjs\ext-all.js ->
C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.23\webapps\wam-bpm-ext\extjs\src\core\src\Support.js ->
C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.23\webapps\wam-bpm-ext\.\extjs\ext.js ->
C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.23\webapps\wam-bpm-ext\extjs\src\core\src\perf\Monitor.js ->
C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.23\webapps\wam-bpm-ext\extjs\src\core\src\util\DelayedTask.js ->
C:\Program Files\Apache Software Foundation\apache-tomcat-7.0.23\webapps\wam-bpm-ext\extjs\src\core\src\util\DelayedTask.js
[ERROR] Error executing page compilation com.sencha.exceptions.BasicException: com.sencha.exceptions.BasicException: com.s
encha.exceptions.BasicException: com.sencha.exceptions.ExCircularReference: Circular requires reference for file C:\Program Files\
Apache Software Foundation\apache-tomcat-7.0.23\webapps\wam-bpm-ext\extjs\src\core\src\util\DelayedTask.js
[ERROR] com.sencha.exceptions.BasicException: com.sencha.exceptions.BasicException: com.sencha.exceptions.BasicException:
com.sencha.exceptions.BasicException: com.sencha.exceptions.ExCircularReference: Circular requires reference for file C:\Program F
iles\Apache Software Foundation\apache-tomcat-7.0.23\webapps\wam-bpm-ext\extjs\src\core\src\util\DelayedTask.js


Am I missing something.

NKrishnawat
26 Oct 2012, 10:20 AM
Thanks, I was able to generate single js file, I started with something simple like this:


<!DOCTYPE html><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/icons/favicon.ico" type="image/x-icon" />
<title>Account Transitions</title>
<link rel="stylesheet" type="text/css" href="css/bpm-ext-style.css"/>
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css"/>
<link rel="stylesheet" type="text/css" href="style.css"/>
<link rel="stylesheet" type="text/css" href="ux/css/BoxSelect.css" />
<link rel="stylesheet" type="text/css" href="ux/css/ItemSelector.css" />
<link rel="stylesheet" type="text/css" href="ux/css/CheckHeader.css">
<script type="text/javascript" src="extjs/ext-all-debug.js"></script>
<script type="text/javascript" src="ux/swfobject/swfobject.js"></script>
<script type="text/javascript" src="ux/exporter/downloadify.min.js"></script>
<script type="text/javascript" src="Common-util.js"></script>
<script type="text/javascript">
Ext.Loader.setConfig({enabled: true});
Ext.Loader.setPath('Ext.ux', 'ux');
Ext.require([
'Ext.form.Panel',
'Ext.ux.form.MultiSelect',
'Ext.ux.form.ItemSelector',
'Ext.ux.grid.Printer',
'Ext.ux.exporter.Exporter',
'Ext.ux.CheckColumn'
]);

</script>
<script type="text/javascript" src="data/UrlParam.js"></script>
<script type="text/javascript" src="ux/miframe/ManagedIframe.js"></script>
<script type="text/javascript" src="ux/src/BoxSelect.js"></script>
<script type="text/javascript" src="coach20.js"></script>
<script type="text/javascript" src="global.js"></script>
<!-- <x-compile> -->
<script type="text/javascript" src="Application.js"></script>
<!-- </x-compile> -->
<script type="text/javascript" src="sharepoint.js"></script>
</head>
<body>
<div id="loading">
<div id="loadingMessage" class="loading-indicator">Loading...</div>
</div>
<div id="renderhere"></div>
<div id="itemselector" class="demo-ct"></div>
</body>
</html>

But when I load the page on browser after replacing index.html and all-classes.js I get issues with two javascript files:




[Ext.Loader] Synchronously loading 'Portal.view.advancedSearch.AdvancedSearch'; consider adding Ext.require('Portal.view.advancedSearch.AdvancedSearch') above Ext.onReadyall-classes.js:1
GET http://localhost:8080/wam-bpm-ext/Portal/view/advancedSearch/AdvancedSearch.js?_dc=1351275131376 404 (Not Found) all-classes.js:1
Uncaught Error: [Ext.Loader] Failed loading synchronously via XHR: 'Portal/view/advancedSearch/AdvancedSearch.js'; please verify that the file exists. XHR status code: 404 all-classes.js:1
GET http://localhost:8080/wam-bpm-ext/src/ux/layout/component/form/ItemSelector.js?_dc=1351275131532 404 (Not Found) all-classes.js:1
Uncaught Error: [Ext.Loader] Failed loading synchronously via XHR: 'http://localhost:8080/wam-bpm-ext/src/ux/layout/component/form/ItemSelector.js'; please verify that the file exists. XHR status code: 404

AdvancedSearch is defined in my project. I am creating an instance using Ext.create(...AdvancedSearch) but its not declared anywhere using xtype.

ItemSelector is ux file. Path http://localhost:8080/wam-bpm-ext/src/ux/layout/component/form/ItemSelector.js is wrong , it is somehow appending src in path.
Browser is showing blank.

dongryphon
26 Oct 2012, 2:17 PM
At least one issue is that your ext-all-debug.js tag is outside the x-compile block and hence will remain in the output html file. The framework code will then also be included via your classpath by the compiler in to all-classes.js.

The sketched code below will tell the compiler to replace all of these script tags with your all-classes.js. By wrapping the framework in x-bootstrap, we avoid including 100% of the framework. I suspect there will be some issues with some of these scripts, but maybe not. If so, you can try removing some of them to see how the build goes and narrow down those problems.



<!-- <x-compile> -->
<!-- <x-bootstrap> -->
<script type="text/javascript" src="extjs/ext-all-debug.js"></script>
<!-- <x-bootstrap> -->

<script type="text/javascript" src="ux/swfobject/swfobject.js"></script>
<script type="text/javascript" src="ux/exporter/downloadify.min.js"></script>
<script type="text/javascript" src="Common-util.js"></script>
<script type="text/javascript">
Ext.Loader.setConfig({enabled: true});
Ext.Loader.setPath('Ext.ux', 'ux');
Ext.require([
'Ext.form.Panel',
'Ext.ux.form.MultiSelect',
'Ext.ux.form.ItemSelector',
'Ext.ux.grid.Printer',
'Ext.ux.exporter.Exporter',
'Ext.ux.CheckColumn'
]);
</script>
<script type="text/javascript" src="data/UrlParam.js"></script>
<script type="text/javascript" src="ux/miframe/ManagedIframe.js"></script>
<script type="text/javascript" src="ux/src/BoxSelect.js"></script>
<script type="text/javascript" src="coach20.js"></script>
<script type="text/javascript" src="global.js"></script>
<script type="text/javascript" src="Application.js"></script>
<script type="text/javascript" src="sharepoint.js"></script>
<!-- </x-compile> -->

NKrishnawat
1 Nov 2012, 5:14 PM
I changed index.html how you have described, I am getting following error:


C:\work\wam-bpm-ext>C:\software\Sencha\Cmd\3.0.0.190\sencha compile -classpath=extjs/src,app page -yui -in index.html -out build/index.htmlSencha Cmd v3.0.0.190[INFO ]
Compiling page null[INFO ]
Processing classPath entry : C:\work\wam-bpm-ext\sencha-compile-temp-dir[INFO ]
Processing classPath entry : extjs\src[INFO ] Processing classPath entry : app[INFO ]
Processing class inheritance graph[ERROR]
Failed to resolve dependency Ext.Error for file Ext.ux.ManagedIframe.Error[ERROR]
Error executing page compilation Unknown definition for dependency : Ext.Error[ERROR]
com.sencha.exceptions.ExNotFound: Unknown definition for dependency : Ext.Error

Reason is that ManagedIframe needs Ext.Error class. I was thinking that Ext.Error should be added by itself when the sencha compiler add Extjs4.1.1a related code in all-classses.js.

dongryphon
1 Nov 2012, 10:23 PM
Try adding this to ext/src/lang/Error.js:



//@define Ext.Error


Just to see if that fixes the problem. It appears that because Ext.Error is "below" Ext.define, it cannot use that mechanism to make the class known to the compiler and also does not have the above. If that helps, I will add that on the framework side.

NKrishnawat
2 Nov 2012, 8:44 AM
That worked.

I was able to create single file.
Got runtime issue though, During page load I got following error on chrome:

Uncaught Error: [Ext.createByAlias] Cannot create an instance of unrecognized alias: widget.fieldset
all-classes.js:1 (http://localhost:8080/wam-bpm-ext/all-classes.js)

The application did not load and showed blank page.

dongryphon
2 Nov 2012, 2:36 PM
Is that happening in your dev mode or in a build? If in a build, there must be some missing dependency. How many places do you have fieldset? The auto-dependency scanner should pick this up but maybe not.

NKrishnawat
7 Nov 2012, 5:51 PM
Finally I was able to create single js app :)
But
I had to add lot of script tags in index.html, practically for all controllers, model and store files which was quiet upsetting (When the page loaded in browser it was complaining about missing files and I had to eventually add all the files using script tag ).

Here is my latest index.html



<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="/icons/favicon.ico" type="image/x-icon" />
<title>Account Transitions</title>
<link rel="stylesheet" type="text/css" href="css/bpm-ext-style.css"/>
<link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css"/>
<link rel="stylesheet" type="text/css" href="style.css"/>
<link rel="stylesheet" type="text/css" href="ux/css/BoxSelect.css" />
<link rel="stylesheet" type="text/css" href="ux/css/ItemSelector.css" />
<link rel="stylesheet" type="text/css" href="ux/css/CheckHeader.css">
<!-- <x-compile> -->
<!-- <x-bootstrap> -->
<script type="text/javascript" src="extjs/ext-all-debug.js"></script>
<!-- </x-bootstrap> -->
<script type="text/javascript" src="ux/swfobject/swfobject.js"></script>
<script type="text/javascript" src="ux/exporter/downloadify.min.js"></script>
<script type="text/javascript" src="ux/src/BoxSelect.js"></script>
<script type="text/javascript">
Ext.Loader.setConfig({enabled: true});
Ext.Loader.setPath('Ext.ux', 'ux');
Ext.require([
'Ext.layout.component.FieldSet',
'Ext.form.FieldSet',
'Ext.form.Panel',
'Ext.ux.form.MultiSelect',
'Ext.ux.form.ItemSelector',
'Ext.ux.grid.Printer',
'Ext.ux.exporter.Exporter',
'Ext.ux.CheckColumn',
'Ext.data.reader.Array'
]);
</script>
<script type="text/javascript" src="data/UrlParam.js"></script>
<script type="text/javascript" src="ux/miframe/ManagedIframe.js"></script>
<script type="text/javascript" src="coach20.js"></script>
<script type="text/javascript" src="global.js"></script>

<script type="text/javascript" src="app/model/Client.js"></script>
<script type="text/javascript" src="app/model/Comments.js"></script>
<script type="text/javascript" src="app/model/Employee.js"></script>
<script type="text/javascript" src="app/model/MonthlyTransitions.js"></script>
<script type="text/javascript" src="app/model/Office.js"></script>
<script type="text/javascript" src="app/model/Portfolio.js"></script>
<script type="text/javascript" src="app/model/PortfolioSummary.js"></script>
<script type="text/javascript" src="app/model/SearchResults.js"></script>
<script type="text/javascript" src="app/model/Status.js"></script>
<script type="text/javascript" src="app/model/User.js"></script>
<script type="text/javascript" src="app/model/UserGroup.js"></script>
<script type="text/javascript" src="app/model/UserGroupGroup.js"></script>
<script type="text/javascript" src="app/model/UserGroupUser.js"></script>



<script type="text/javascript" src="app/store/UserLookUpStore.js"></script>
<script type="text/javascript" src="app/store/UserGroupUserStore.js"></script>
<script type="text/javascript" src="app/store/UserGroupStore.js"></script>
<script type="text/javascript" src="app/store/UserGroupGroupStore.js"></script>
<script type="text/javascript" src="app/store/StatusStore.js"></script>
<script type="text/javascript" src="app/store/SearchResultStore.js"></script>
<script type="text/javascript" src="app/store/SearchResultSingleRecordStore.js"></script>
<script type="text/javascript" src="app/store/RmLookUpStore.js"></script>
<script type="text/javascript" src="app/store/PortfolioSummaryStore.js"></script>
<script type="text/javascript" src="app/store/PortfolioLookUpStore.js"></script>
<script type="text/javascript" src="app/store/PmLookUpStore.js"></script>
<script type="text/javascript" src="app/store/PaLookUpStore.js"></script>
<script type="text/javascript" src="app/store/OfficeLookUpStore.js"></script>
<script type="text/javascript" src="app/store/NewTreeLookupStore.js"></script>
<script type="text/javascript" src="app/store/MonthlyTransitionsStore.js"></script>
<script type="text/javascript" src="app/store/DetailsTreeStore.js"></script>
<script type="text/javascript" src="app/store/CseLookUpStore.js"></script>
<script type="text/javascript" src="app/store/CsaLookUpStore.js"></script>
<script type="text/javascript" src="app/store/CommentsStore.js"></script>
<script type="text/javascript" src="app/store/CoLookUpStore.js"></script>
<script type="text/javascript" src="app/store/ClosingTreeLookupStore.js"></script>
<script type="text/javascript" src="app/store/ClientLookUpStore.js"></script>
<script type="text/javascript" src="app/store/CattLookUpStore.js"></script>

<script type="text/javascript" src="app/controller/reports/ReportsController.js"></script>
<script type="text/javascript" src="app/controller/searchresult/SearchResultController.js"></script>
<script type="text/javascript" src="app/controller/searchtoolbar/AdvanceSearchController.js"></script>
<script type="text/javascript" src="app/controller/statusgrid/StatusController.js"></script>
<script type="text/javascript" src="app/controller/tab/TabController.js"></script>
<script type="text/javascript" src="app/controller/tree/TreeController.js"></script>

<script type="text/javascript" src="Application.js"></script>
<script type="text/javascript" src="sharepoint.js"></script>
<script type="text/javascript" src="Common-util.js"></script>
<!-- </x-compile> -->

</head>
<body>
<div id="loading">
<div id="loadingMessage" class="loading-indicator">Loading...</div>
</div>
<div id="renderhere"></div>
<div id="itemselector" class="demo-ct"></div>
</body>
</html>


Not sure why auto-dependency scanner is not loading controllers, model and store by itself. I tried same "sencha compile page" command with sample "pandora" application (which is in extjs examples ) but I found similar results , I had to explicitly add script tags.
Why so ?

dongryphon
7 Nov 2012, 11:37 PM
That surely isn't the way it should be... :(

Can you post references in your app (the models, views and controllers arrays in the Ext.application call)?

Then let's pick "app/model/UserGroupUser.js" ... can you find the references to that model in the models array of your app/controllers and post them here? Maybe that will help explain some things.

NKrishnawat
8 Nov 2012, 5:17 PM
I have not specified model in any controller or even in Application.js. I simply specified controllers and stores in application.js. Models are loaded automatically because stores refer them, Here is my application.js:


Ext.Loader.setConfig({
enabled : true
});


Ext.require('Portal.view.advancedSearch.AdvancedSearch');
Ext.require('Ext.grid.plugin.CellEditing');
Ext.require('Ext.grid.feature.Grouping');
Ext.require('Ext.layout.container.Border');
Ext.require('Ext.data.TreeStore');


Ext.application(
{
name : 'Portal',

autoCreateViewport : true,


////// models: ['SearchResults'],


stores : ['TopicStore', 'ClientLookUpStore', 'SearchResultStore', 'CseLookUpStore', 'CsaLookUpStore', 'CattLookUpStore', 'CoLookUpStore', 'PmLookUpStore', 'PaLookUpStore', 'PortfolioLookUpStore', 'OfficeLookUpStore', 'StatusStore','SearchResultSingleRecordStore', 'CommentsStore', 'ClosingTreeLookupStore', 'NewTreeLookupStore', 'UserLookUpStore', 'UserGroupUserStore', 'UserGroupGroupStore', 'RmLookUpStore', 'UserGroupStore', /*'MonthlyTransitionsStore', */'PortfolioSummaryStore'],


controllers : [ 'searchtoolbar.AdvanceSearchController', 'tree.TreeController', 'searchresult.SearchResultController', 'statusgrid.StatusController', 'reports.ReportsController' ]
});

Should models and stores be defined in individual controllers in order for auto-dependency scanner to load them ?

Also all view references in my application is on Viewport.js (Under "requires" array), I haven't moved them in individual controllers.

dongryphon
8 Nov 2012, 10:29 PM
The dependency scan follows stores as you have them and the "model" property of the store... can you send one of your store definitions?

NKrishnawat
9 Nov 2012, 9:44 AM
Store #1:


Ext.define('Portal.store.SearchResultStore', { extend: 'Ext.data.Store',
model: 'Portal.model.SearchResults',
groupField: 'process',
pageSize: 10,
sorters: { property: 'process', direction : 'DESC' },
autoLoad: true
});

Store #2:


Ext.define('Portal.store.TopicStore', { extend : 'Ext.data.TreeStore',
autoLoad : false,
proxy : {
type : 'ajax',
url : '/wam-bpm-ext/rest/collaboration/topic/31558/2000000/'+ loggedInUser,
reader : {
type : 'json',
root : 'children'
}
}
});