PDA

View Full Version : [CLOSED][PR5] Issues with Ext.data.clientProxy



xcambar
20 Mar 2011, 4:29 PM
When running the code




Ext.define('Tab.Proxy.User', {
'extend' : 'Ext.data.ClientProxy'
});



When I'm trying to instantiate my Tab.User.Proxy, an exception is raised telling me that the namespace Tab.User.Proxy is undefined.

The code is running within NodeJS, the dependency loading mechanism is enabled as sychronous and working. The matter of surprise is that if I replace 'Ext.data.ClientProxy' by 'Ext.data.ServerProxy' or whatever proxy which is not a descendent of ClientProxy, it works.

evant
20 Mar 2011, 4:32 PM
Runs fine for me.



Ext.require('Ext.data.*');

Ext.define('Tab.User.Proxy', {
extend: 'Ext.data.ClientProxy'
});

Ext.onReady(function() {
});

xcambar
21 Mar 2011, 5:26 AM
Great, that works!

However, as I said, I'm working on the server side, and your sample remains a short-term solution, for the following reasons:

I intend the Ext.define method to load automatically the dependencies I require in my configuration
Having to load the whole data package for having a single class to be enabled is quite inefficient because of the memory footprint it brings
Although I could use Ext.require("Ext.data.ClientProxy"), it does make any use of the features that Sencha claims to bring throughout the auto-loader provided in ExtJS4
The point of framework using an autoloader is to take care by itself of all the dependencies within the services provided by the framework, which is not the case in your workaround because I will have to specify at least a Ext.require("Ext.data.ClientProxy") as a header of my class declaration


I'm glad that, thanks to you, I'm not stuck anylonger with my code, but are there any plans at Sencha to avoid the explicit use of Ext.require when requiring dependencies in Ext.define ?

Thanks for your answer,
Regards

evant
21 Mar 2011, 5:35 AM
You already can do this. For example:



Ext.define('Foo', {
extend: 'Ext.panel.Panel'
});

Ext.onReady(function(){
new Foo({
width: 200,
height: 200,
renderTo: document.body
});
});


Note that I'm not using the built version, it's loading everything from source.