-
26 May 2011 10:27 AM #1
How to implement Ext.Direct in MVC architecture with ExtJs 4?
How to implement Ext.Direct in MVC architecture with ExtJs 4?
Hi,
I used this with ExtJs 3.3
And something like this to call my methodCode:Ext.Direct.addProvider(WMS.API); Ext.Direct.on('exception', function(e) { Ext.Msg.alert('Exception', e.message); });
How is the good way to implement this with Ext Js 4 in MVC architecture?Code:this.entityTypeStore = new Ext.data.DirectStore({ reader: this.entityTypeReader, api : { read : WMS.WS_EntityType.getAll } });
Thank you in advance for all the answers
-
10 Jan 2013 2:19 AM #2
Hello.
Have you found solution to the problem?
-
10 Jan 2013 10:37 AM #3
As of 4.2 Beta 2, this is not a problem anymore. Add Providers in Application's launch method, and use stringified Direct method names, like this:
Regards,Code:Ext.define('MyApp.view.SomeGrid', { extend: 'Ext.grid.Panel', store: { proxy: { type: 'direct', api: { read: 'WMS.WS_EntityType.getAll' } } ... } }); Ext.define('MyApp.Application', { extend: 'Ext.app.Application', launch: function() { Ext.direct.Manager.addProvider(WMS.API); } ... }); Ext.application('MyApp.Application');
Alex.
-
10 Jan 2013 8:39 PM #4
-
27 Mar 2013 9:32 AM #5
I would like to add just that if you had
in your Application declaration then it would'nt work ( it will create the view port before registering the remote api) the solution is quite simple, just set autoCreateViewport to false, and than in Application.launch create the viewport manually after registering the remote api:Code:autoCreateViewport : true
Have a nice day :-DCode:launch: function() { console.log("Launching Gestionale"); Ext.direct.Manager.addProvider(Ext.app.REMOTING_API); this.viewport = Ext.create('Gestionale.view.Viewport'); }
Michele
Last edited by ZIOLele; 27 Mar 2013 at 9:33 AM. Reason: horrible typo


Reply With Quote