
Originally Posted by
elpaw
Hi All,
I extend Ext.Panel to myPanel and use like this:
I would like to read additional parameters from database using synchronous ajax request (in myPanel) and then use returned values as config togather with params1 and params2.
How is the easiest way to do this?
The only way to do that currently (especially in a Viewport) is to use the ext-basex/JIT extensions (see my sig below), and:
Code:
var objV = new Ext.Viewport({
require : [{method:'DOM',debug:true, params: {arg1:1, arg2:2}}, 'classes/myPanel.js'],
items: [{
xtype: 'myPanel',
.....
}]
});
Note: The method: DOM, debug:true config permits debugging during development. 
or you could manage it another way (asynchronously) by module (source-file) name:
Code:
$JIT.setMethod('DOM');
Ext.onReady(function(){
$JIT({debug:true, params: {arg1:1, arg2:2}}, 'classes/myPanel.js', 'classes/myGridCls.js);
$JIT.onAvailable(['myPanel','myGridCls'], function(ok){
if(!ok)throw 'we timed out';
var objV = new Ext.Viewport({
items: [{
xtype: 'myPanel',
.....
}]
});
});
});
And, the next version (in trunk) supports by ClassName:
Code:
$JIT.onClassAvailable(['Ext.ux.myPanel','Ext.ux.myGridCls'], function(ok){
if(!ok)throw 'we timed out';
var objV = new Ext.Viewport({
items: [new Ext.ux.myPanel({region: 'center'}),
new Ext.ux.myGridCls({region: 'south'})
],
.....
});
});
});
Ah, the shameful plugs 