-
18 Jul 2008 3:40 AM #141"be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.
-
18 Jul 2008 5:13 AM #142
Doug, you are a hero

The module manager.load works like a charm!
I will post a demo soon, KRavEN and I have thought of a real nice way to dynamically load new xtype-definitions, by extending the ComponentMgr.create method.
with the synchronize load-calls we can make with your module manager we can request the js-file on demand if the xtype isn't known yet :O
for the people who haven't figured out how to do so. a small example:
(similar examples can also be found in the basex-source)Code:App.CodeLoader = new Ext.ux.ModuleManager({modulePath: baseUrl }); App.CodeLoader.load( {async:false, method:'SCRIPT'}, '/js/' + modulename + '/listAjaxGridPanelJs.pjs');Leon
-
18 Jul 2008 5:34 AM #143
Good to hear you guys are making progress.

Here is a fragment of what JIT adds for what you are attempting:
Which permits:Code:Ext.require({method:'GET'}, 'widget-core',function(success){ if(success){ var mgr = Ext.ComponentMgr; mgr.create = mgr.create.createInterceptor(function(config, defaultType){ var require; if(require = config.require){ var o = {async:false}, setAsynch = function(rm){ return typeof rm === 'object' ? Ext.apply({},o,rm): typeof rm ==='function' ? rm : {module:rm,async:false}; }; if(Ext.isArray( require) ){ require = require.map( setAsynch ); } else { require = setAsynch(require); } Ext.require.apply(Ext,[].concat(require) ); } }); } });
Slow down guys, you're stealin' my thunder.Code:container.add({ xtype:'panel', require: ['tabs','grid','gmaps'], items: [.....] , ..... });
"be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.
-
19 Jul 2008 9:35 AM #144
Thunder and lightning are in the air!

I've adjusted the Ext.ComponentMgr.create method to make it request new scripts at the server if it detects the to be instantiated xtype is unknown. That is whay I call Lazy Loading
A demo can be found here:
http://tejohnston.dynora.eu/ (admin admin)
all grid-panels and form-panels you see are being requested with the Ext.ux.ModuleManager.load method (at the moment with a GET request, so not injecting the scripts into the header) when a xtype is being instantiated but not known yet.
It even works when you first need to login before you have enough credentials to retrieve the script! After login the request is being repeated automatically to show you the correct panels. (This is where the GET probably is an advantage above injecting scripts, since with injecting you would need to replace the result you got when you didn't had enough credentials, which now is solved automatically).
The only problem with GET is debugging is a little harder.
for Doug! for his great work! and help!
A small example of what now is possible:
I don't need to load a script which defines this formpanel, it is being generated by my Symfony sfExtjsThemePlugin and automatically requested upon first use by my create.createInterceptor from the server!Code:var editWindow = new Ext.Window({ items : [ { xtype : ('Edit' + this.relatedModuleName + 'FormPanel').toLowerCase() } ] }); editWindow.show();Last edited by lvanderree; 19 Jul 2008 at 9:39 AM. Reason: added small example
Leon
-
21 Jul 2008 12:05 PM #145
@Doug: Is there a way to configure a queue to only handle one request at a time (even if there are other "slots" available)? In other words, a queue so configured would still be processed at its priority level, but only allow one outstanding request at a time, with any other requests in that queue just waiting until the outstanding request was complete.
-
21 Jul 2008 5:23 PM #146
@Eric24 -- What you are asking for is 'sequential optimism', not queuing. See if this asynch pattern fits your needs (it won't begin the next until the previous has completed).
"be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.
-
22 Jul 2008 6:16 AM #147
@Doug: The 'sequential optimism' (what a strange term) pattern is well understood, but I was hoping to do something like this within the context of the basex queues (so I don't have to manage these requests externally). Essentially, I want to take advantage of the queuing but either allow for a config option that puts a queue into "one at a time" mode (at which point I could trigger the next request--somehow?--in the success handler) or better yet, a "sequential" mode that does this under the covers. Whether each individual request succeeds or fails would still be handled in the respective success/failure handler, the only difference is that a queue in "sequential" mode would hold all but one of its requests (no different than if the max outstanding request limit had been reached). By integrating this with basex queues, you then have the option of controlling the request priority both by queue priority and by "sequential/parallel" mode.
Of course, whether you decide to do this or not is entirely up to you (I'm not quite advanced enough in ExtJS just yet to feel like I could make this mod in a reasonable period of time), but I'm curious to know if you see this as a useful addition?
Thanks
Eric
-
23 Jul 2008 4:30 AM #148
@Eric24 -- I believe a combination of the current progressive (one-at-a-time) queue mode and a single event listener, is all you'll need. Here is an example of how you would create that behavior with a series of queued requests:
I hesitate to introduce internal functionality (as you describe) that might be based on success/failure. IMHO: Each implementation has specific needs in those scenarios and I don't think a sensible series of 'config options' could handle every use-case.PHP Code:var A = Ext.lib.Ajax;
var QM = A.queueManager;
var Q=QM.createQueue({name:'chained', priority: 3, progressive:true, suspended:true }); //one-at-a-time mode
A.on('request', function(method, uri, cb, data, options){
var Q=options.queue;
if(Q && Q.name == 'chained')Q.suspend(); //suspend the queue again until current completes
});
var add = function(){
Ext.Ajax.request({
url:url,
queue: Q.name ,
success: function(response){
var options = response.options;
if(options.queue){
options.queue.resume(); //re-enable for next request
QM.start();
}
//do your thing
},
failure : function( ) { same thing or dump the entire queue ??? },
....
});
};
//fill the Queue with 10 requests
for(var i=0,i<10,i++)add();
Q.resume();
QM.start(); //get things started
Queue behavior options and EventListeners, as shown above, offer tremendous flexibility for your own way of doing things.
Give that a try."be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.
-
24 Jul 2008 2:17 PM #149
I keep getting very sporatic errors of:
Ext.lib.Ajax.on is not a function
Noted in Firefox with Firebug.
I'm guessing this is because Ext.lib.Ajax has not fully loaded by the time I start using it?
However I am loading ext-all.js and ext-basex-min.js before I use any of if. (They are in the header).
Is there some synchronization issue or something? Does Ext.lib.Ajax need to be inside or outside of an Ext.onReady() {}?
thanks...
-
25 Jul 2008 4:30 AM #150
@ClemsonJeeper -- I suspect you may not have it (basex) loaded in the proper order, or you may not be waiting until onReady to do "something". Can you post your <head> section and describe in more detail what you are attempting when things go nuts?
"be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.






)
Reply With Quote