home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mobiclic 136
/
MOBICLIC136.ISO
/
pc
/
DATA
/
HOTE
/
libs
/
amfphp
/
amfphp.swf
/
scripts
/
__Packages
/
mx
/
remoting
/
DataGlue.as
< prev
next >
Wrap
Text File
|
2011-07-20
|
3KB
|
127 lines
class mx.remoting.DataGlue extends Object
{
static var version = "1.2.0.124";
function DataGlue(dp)
{
super();
this.__dataProv = dp;
}
function get dataProvider()
{
return this.__dataProv;
}
function get labelString()
{
return this.__labelStr;
}
function set labelString(val)
{
this.__labelStr = val;
}
function get dataString()
{
return this.__dataStr;
}
function set dataString(val)
{
this.__dataStr = val;
}
static function bindFormatStrings(dataConsumer, dp, labelStr, dataStr)
{
var _loc1_ = new mx.remoting.DataGlue(dp);
_loc1_.__set__labelString(labelStr);
_loc1_.__set__dataString(dataStr);
_loc1_.getItemAt = mx.remoting.DataGlue.prototype.getItemAt_FormatString;
dataConsumer.dataProvider = _loc1_;
}
static function bindFormatFunction(dataConsumer, dp, formatFunc)
{
var _loc1_ = new mx.remoting.DataGlue(dp);
_loc1_.formatFunction = formatFunc;
_loc1_.getItemAt = mx.remoting.DataGlue.prototype.getItemAt_FormatFunction;
dataConsumer.setDataProvider(_loc1_);
}
function addEventListener(eventName, listener)
{
this.dataProvider.addEventListener(eventName,listener);
}
function get length()
{
return this.getLength();
}
function getLength()
{
return this.dataProvider.length;
}
function format(formatString, item)
{
var _loc3_ = formatString.split("#");
var result = "";
var tlen = _loc3_.length;
var _loc2_ = undefined;
var _loc1_ = 0;
while(_loc1_ < tlen)
{
result += _loc3_[_loc1_];
_loc2_ = _loc3_[_loc1_ + 1];
if(_loc2_ != undefined)
{
result += item[_loc2_];
}
_loc1_ += 2;
}
return result;
}
function getItemAt_FormatString(index)
{
var _loc2_ = this;
var _loc1_ = _loc2_.dataProvider.getItemAt(index);
if(_loc1_ == "in progress" || _loc1_ == undefined)
{
return _loc1_;
}
return {label:_loc2_.format(_loc2_.__get__labelString(),_loc1_),data:(_loc2_.__get__dataString() != null ? _loc2_.format(_loc2_.__get__dataString(),_loc1_) : _loc1_)};
}
function getItemAt_FormatFunction(index)
{
var _loc1_ = this.dataProvider.getItemAt(index);
if(_loc1_ == "in progress" || _loc1_ == undefined)
{
return _loc1_;
}
return this.formatFunction(_loc1_);
}
function getItemID(index)
{
return this.dataProvider.getItemID(index);
}
function addItemAt(index, value)
{
this.dataProvider.addItemAt(index,value);
}
function addItem(value)
{
this.dataProvider.addItem(value);
}
function removeItemAt(index)
{
this.dataProvider.removeItemAt(index);
}
function removeAll()
{
this.dataProvider.removeAll();
}
function replaceItemAt(index, itemObj)
{
this.dataProvider.replaceItemAt(index,itemObj);
}
function sortItemsBy(fieldNames, optionFlags)
{
this.dataProvider.sortItemsBy(fieldNames,optionFlags);
}
function sortItems(compareFunc, optionFlags)
{
this.dataProvider.sortItems(compareFunc,optionFlags);
}
}