-
11 Sep 2012 5:48 PM #1
Answered: Call Controller function outside Ext namespace
Answered: Call Controller function outside Ext namespace
Hello, everyone.
I want to call controller method in <script> section in index.html. Can I do it and how?
Thanks for advice
-
Best Answer Posted by indapublic
Resolved (by using gloval variable App)
-
12 Sep 2012 2:21 AM #2
Resolved (by using gloval variable App)
-
18 Oct 2012 3:47 AM #3
Can you give an example please?
I have the same problem.
Thanks.
-
18 Oct 2012 3:52 AM #4
Hello! Of course.
index.html
app.jsCode:... <link href="resources/css/main.css" media="screen" rel="stylesheet" type="text/css"> <script id="microloader" type="text/javascript" src="sdk/microloader/development.js"></script> <script type="text/javascript"> var g_App = undefined, ....
And run, for example:Code:... launch: function() { // Destroy the #appLoadingIndicator element Ext.fly('appLoadingIndicator').destroy(); g_App = this; // Initialize the main view }, ...
Code:g_App.getController('News').LoadData();
-
18 Oct 2012 7:02 AM #5
-
6 Dec 2012 8:24 AM #6
Doesn't work for me, the global variable remains undefined while assigned one's scope is launch() function
<myAppName>.app.getControllerInstances()['<controllerName>'] does the job though
-
6 Dec 2012 10:41 PM #7
Can you attach your unworking project?
-
10 Dec 2012 5:12 AM #8
Irrelevant now, got it working apparently. Thanks for your reply.


Reply With Quote