PDA

View Full Version : Ext 3.0??Ext.Ajax.abort



Kazuhiro Kotsutsumi
14 Apr 2009, 12:49 AM
ExtJS 3.0?????????????yuki????????????????

???Ext.Ajax.abort???????????

???????????????Ext.direct.PaulingProvider??Ext.TaskMgr??????????????????????????????????????????????????????
?????????????????????????????????tId?????Ext.Ajax.abort?????????????????????????????????

Kazuhiro Kotsutsumi
14 Apr 2009, 1:10 AM
???????

???????
API????abort????tId????????request??????????????????????
?????????????

???Ext.direct.PollingProvider??disconnect???????????????????????????????

?????????


/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
// +-------------------------------------------------------------------------+
// | JavaScript |
// +-------------------------------------------------------------------------+
// | Copyright (c) 2006 - 2009 Xenophy CO., LTD. |
// +-------------------------------------------------------------------------+
// | LICENSE: This library is free software; you can redistribute it and/or |
// | modify it under the terms of the GNU Lesser General Public |
// | License as published by the Free Software Foundation; either |
// | version 3 of the License, or (at your option) any later |
// | version. |
// | See the GNU Lesser General Public License for more details. |
// | Details have been described to the LICENSE file. |
// +-------------------------------------------------------------------------+
// | Authors: Kazuhiro Kotsutsumi <kotsutsumi@xenophy.com> |
// +-------------------------------------------------------------------------+
//
// $Id: ObjectPropertyGrid.js 1441 2009-04-14 02:17:46Z kotsutsumi $

/**
* ?????????????????
*
* @license LGPL3
* @author Kazuhiro Kotsutsumi <kotsutsumi@xenophy.com>
* @since 0.1
*/

// {{{ Ext.ux.PollingProvider

/**
* Ext.ux.PollingProvider
*
* ?????????????
*
* @author Kazuhiro Kotsutsumi <kotsutsumi@xenophy.com>
* @class Ext.ux.PollingProvider
* @extends Ext.grid.PropertyGrid
* @since 0.1
*/
Ext.ux.PollingProvider = Ext.extend( Ext.direct.PollingProvider, {

connect: function(){
if(this.url && !this.pollTask){

this.pollTask = Ext.TaskMgr.start({
run: function(){

if(this.fireEvent('beforepoll', this) !== false){
if(typeof this.url == 'function'){
this.url(this.baseParams);
}else{
this.activeRequest = Ext.Ajax.request({
url: this.url,
callback: this.onData,
scope: this,
params: this.baseParams
});
}
}
},
interval: this.interval,
scope: this
});

this.fireEvent('connect', this);
}else if(!this.url){
throw 'Error initializing PollingProvider, no url configured.';
}
},

disconnect: function(){

if(this.pollTask){

Ext.TaskMgr.stop(this.pollTask);
delete this.pollTask;

Ext.Ajax.abort( this.activeRequest );

this.fireEvent('disconnect', this);
}
}

});

// }}}

/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* c-hanging-comment-ender-p: nil
* End:
*/