PDA

View Full Version : ????????????????????????????



nasust
21 Sep 2009, 6:59 PM
???????????????

ExtJS3????????????????

ExtJS3??????????????????????????????????????????????????????

????????????????????????

1.Window??????
2.????????????
3.Ajax.request???
4.Ajax.request?????????????????????????Window???items??????doLayout
5.doLayout???????????????

???????????????


window.on( "show" , showLoadMask , window ) //show????????????????????
.on( "show" , ajaxRequest , connection )//show???????????Ajax.request
.on( "requestcomplete" , windowItemRefresh , window ) //requestcomplete???????????doLayout
.on( "afterlayout" , hideLoadMask , window );//afterlayout???????????????

*scope??????????on????scope???????????this????
*function?false?????????????

??????????????????????????????????

????????????????????????

nasust
25 Sep 2009, 2:42 AM
???????????Linux????????????????????????????????????????????



//var eventPipe= new EventPipe( this.onShowDoAJaxRequest , this )
// .onNext( connection , "requestcomplete" , this.onRequestConpleteDoLayout , this )
// .onNext( extWindow , "afterlayout" , this.onAfterLayout , this );
//
//extWindow.on( "show" , eventPipe.exec , eventPipe );
//extWindow.show();

EventPipe = Ext.extend( Ext.util.Observable , {

constructor: function( handler , scope , defaultCheinOptions ){
this.chainList = [];
this.chainIndex = 0;
this.handler = handler;
this.scope = scope;
this.nextOptions = {
single:true
}
Ext.apply( this.nextOptions , defaultCheinOptions );
},

onNext : function( observable , event , handler , scope , options ){

if( !options ){
options = this.nextOptions;
}
if( !scope ){
scope = window;
}

var invokeObservable = {
observable : observable,
event : event,
handler : handler,
scope : scope,
options : options
};

this.chainList.push( invokeObservable );

return this;
},

exec : function(){
this.chainIndex = 0;
if( this.chainList.length > 0 ){
var invokeObservableNext = this.chainList[ 0 ];
invokeObservableNext.observable.on( invokeObservableNext.event , this.execNext , this , invokeObservableNext.options );
}
this.handler.apply( this.scope , arguments );
},

//private
execNext : function(){
var invokeObservable = this.chainList[ this.chainIndex ];
this.chainIndex++;
if( this.chainIndex < this.chainList.length ){
var invokeObservableNext = this.chainList[ this.chainIndex ];
invokeObservableNext.observable.on( invokeObservableNext.event , this.execNext , this , invokeObservableNext.options );
}
invokeObservable.handler.apply( invokeObservable.scope , arguments );
}

} );

yuki
8 Oct 2009, 11:34 PM
????????????????????????????????????????:)
?????????????????????????????????????????????????????????????????????????????????????????????????????????