Hybrid View
-
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' }, ] }); } });
-
19 Apr 2012 6:31 PM #7
-
19 Apr 2012 6:35 PM #8


Reply With Quote