-
27 Jun 2011 4:04 AM #1
Ext.application and Ext.direct: How to setup?
Ext.application and Ext.direct: How to setup?
Hi,
I want to create an Application with Ext.application. In one controller I use a store which uses Ext.direct. Where have I to put the line "Ext.direct.Manager.addProvider(Ext.app.REMOTING_API);"?
If I put it before "Ext.application({..." I get the error "Ext.direct is undefined". If I put it in the " launch: function() {..." area, I get the error that the class which I implement with Ext.direct is not defined.
What is the correct way to use Ext.direct in Ext.application?
Greetings,
Wolfgang
-
28 Jun 2011 10:29 PM #2
Hi
Struggling with the same problem. Found this solution that works for me. Not sure if this is the "correct" approach.
GreetingsCode:Ext.require('Ext.direct.*', function() { Ext.direct.Manager.addProvider(Ext.app.REMOTING_API); }); Ext.application({ .... });
Ralph
-
13 Jul 2011 2:25 AM #3
Hi, having the same problem. My solution looks follow:
I have also written a rpc Json_Server class for the Zend Framework which work like the Zend_Json_Server.Code:Ext.application({ name: 'MyApp', ..... launch: function() { Ext.direct.Manager.addProvider(Ext.app.DirectAPI); } });
Hope it helps.
-
13 Jul 2011 7:18 AM #4
@ralscha
The solution you provided seem not to work.
Trying it I get an error:
BUT ONLY if I use ext-all-debug.js.Code:if (!provider.isProvider) {
Using ext-debug.js it work fine!
Why???
-
17 Jul 2011 10:30 PM #5
Don't know where the problem is in your code. In my example application it works with ext.js and with ext-all.js.
With ext-all.js you don't need Ext.require. You could try if it works after removing the Ext.require call.
-
20 Jul 2011 5:00 AM #6
any update on this>
any update on this>
i am having the same issue: provider is undefined
and my app.js file:Code:<html> <head> <title>Hello Ext</title> <link rel="stylesheet" type="text/css" href="resources/css/ext-all.css"> <script type="text/javascript" src="ext-all-debug.js"></script> <script type="text/javascript" src="app.js"></script> </head> <body></body> </html>
Code:Ext.Loader.setConfig({ enabled: true }); Ext.application({ name: 'MyApp' ,launch: function() { //provide feedback for any errors Ext.tip.QuickTipManager.init(); Ext.direct.Manager.addProvider(Ext.app.DirectAPI); //console.log('Application launch!'); var viewport= Ext.create('Ext.container.Viewport', { layout: 'auto', items: [ { region: 'north', html: '<h1 class="x-panel-header">Page Title</h1>', height: 100, border: false, margins: '0 0 5 0' }, { region: 'center', border: true, layout: { type: 'hbox', } }, { region: 'south', html: '<h1 class="x-panel-header">Page Footer</h1>', height: 80, border: false, margins: '0 0 5 0' }, ] }); } });
-
20 Jul 2011 5:03 AM #7
Think the problem is the loader.
If we use ext-all.js, so all is loaded and no loader is required.
If we use ext.js only the core is direct loaded and the must be load via the loader.
Think so. Have to test it.
PS: I hate the docu here form Sencha. Not really well done.
-
20 Jul 2011 5:21 AM #8
but if i remove loader my app can not find my classes. Very frustrating. I tried adding:
but it says i need to enable Ext.Loader!?!?!?!?Code:Ext.require('SABER.summary.D03Panel');
-
20 Jul 2011 5:42 AM #9
Right. Have the same issue.
The http://www.sencha.com/learn/getting-...with-ext-js-4/ is also not a help.
-
20 Jul 2011 6:00 AM #10
If i get rid of the application and just do this:
Code:Ext.Loader.setConfig({ enabled: true }); Ext.onReady(function() { ...
it works. But now i am back to my problem of Ext.direct not POSTing to the correct URL


Reply With Quote