?? databinding.js
字號:
/* * Bindows 1.10 * http://www.bindows.net/ * Copyright (c) 2003-2004 MB Technologies * * Bindows(tm) belongs to MB Technologies (Georgia, USA). All rights reserved. * You are not allowed to copy or modify this code. Commercial use requires * license. */function BiDataSet(sName)
{BiEventTarget.call(this);if(sName)
this._name=sName;this._tables=[];this._tablesByName={};}
_p=BiDataSet.prototype=new BiEventTarget;_p._className="BiDataSet";_p._name="Unnamed Data Set";_p._dataReady=true;BiDataSet.prototype.getTables=function(){return this._tables;};BiDataSet.prototype.getName=function(){return this._name;};BiDataSet.prototype.getDataReady=function(){return this._dataReady;};_p.getTableByName=function(s){return this._tablesByName[String(s).toLowerCase()];};_p.addTable=function(oTable,oBefore)
{if(oBefore==null)
this._tables.push(oTable);else this._tables.insertBefore(oTable,oBefore);var tName=oTable.getName();if(!tName)
tName=oTable._name=String(this._tables.indexOf(oTable));this._tablesByName[tName.toLowerCase()]=oTable;if(oTable._dataSet)
oTable._dataSet.removeTable(oTable);oTable._dataSet=this;};_p.removeTable=function(oTable)
{this._tables.remove(oTable);delete this._tablesByName[oTable.getName().toLowerCase()];oTable._dataSet=null;return oTable;};_p.dispose=function()
{if(this.getDisposed())return;BiObject.prototype.dispose.call(this);for(var i=this._tables.length-1;i>=0;i--)
{this._tables[i].dispose();this._tables[i]=null;}
this._tables=null;for(i in this._tablesByName)
{this._tablesByName[i]=null;}
this._tablesByName=null;};function BiDataTable(sName)
{BiObject.call(this);if(sName)
this._name=sName;this._columns=[];this._rows=[];this._columnsByName={};}
_p=BiDataTable.prototype=new BiObject;_p._className="BiDataTable";_p._name=null;_p._dataSet=null;BiDataTable.prototype.getName=function(){return this._name;};BiDataTable.prototype.getDataSet=function(){return this._dataSet;};BiDataTable.prototype.getColumns=function(){return this._columns;};BiDataTable.prototype.getRows=function(){return this._rows;};_p.getColumnByName=function(s)
{return this._columnsByName[String(s).toLowerCase()];};_p.addRow=function(oRow,oBefore)
{if(oRow==null)
this._rows.push(oRow);else this._rows.insertBefore(oRow,oBefore);if(oRow._table)
oRow._table.removeRow(oRow);oRow._table=this;};_p.removeRow=function(oRow)
{this._rows.remove(oRow);oRow._table=null;return oRow;};_p.addColumn=function(oColumn,oBefore)
{if(oBefore==null)
{this._columns.push(oColumn);oColumn._index=this._columns.length-1;}
else {this._columns.insertBefore(oColumn,oBefore);for(var i=0;i<this._columns.length;i++)
this._columns[i]._index=i;}
var cName=oColumn.getName();if(!cName)
cName=oColumn._name=String(this._columns.indexOf(oColumn));this._columnsByName[cName.toLowerCase()]=oColumn;if(oColumn._table)
oColumn._table.removeColumn(oColumn);oColumn._table=this;};_p.removeColumn=function(oColumn)
{this._columns.remove(oColumn);oColumn._index=null;for(var i=0;i<this._columns.length;i++)
this._columns[i]._index=i;delete this._columnsByName[oColumn.getName().toLowerCase()];oColumn._table=null;return oColumn;};_p.dispose=function()
{if(this.getDisposed())return;BiObject.prototype.dispose.call(this);for(var i=this._columns.length-1;i>=0;i--)
{this._columns[i].dispose();this._columns[i]=null;}
this._columns=null;for(var i=this._rows.length-1;i>=0;i--)
{this._rows[i].dispose();this._rows[i]=null;}
this._rows=null;for(var i in this._columnsByName)
this._columnsByName[i]=null;this._columnsByName=null;this._dataSet=null;};_p.getDataReady=function()
{return this._dataSet?this._dataSet.getDataReady():false;};function BiDataColumn(sName)
{BiObject.call(this);if(sName)
this._name=sName;}
_p=BiDataColumn.prototype=new BiObject;_p._className="BiDataColumn";_p._name=null;_p._table=null;_p._dataType="string";_p._defaultValue=null;BiDataColumn.prototype.getIndex=function(){return this._index;};BiDataColumn.prototype.getName=function(){return this._name;};BiDataColumn.prototype.getTable=function(){return this._table;};BiDataColumn.prototype.getDataType=function(){return this._dataType;};BiDataColumn.prototype.setDataType=function(v){this._dataType=v;};BiDataColumn.prototype.getDefaultValue=function(){return this._defaultValue;};BiDataColumn.prototype.setDefaultValue=function(v){this._defaultValue=v;};_p.dispose=function()
{if(this.getDisposed())return;BiObject.prototype.dispose.call(this);this._table=null;};function BiDataRow()
{BiObject.call(this);}
_p=BiDataRow.prototype=new BiObject;_p._className="BiDataRow";_p._table=null;BiDataRow.prototype.getTable=function(){return this._table;};_p.dispose=function()
{if(this.getDisposed())return;BiObject.prototype.dispose.call(this);this._table=null;};_p.getValueByIndex=function(){return null;};_p.getValueByName=function(){return null;};function BiXsTypeConverter(){BiObject.call(this);}
_p=BiXsTypeConverter.prototype=new BiObject;_p._className="BiXsTypeConverter";BiXsTypeConverter._types={"negativeInteger":0,"unsignedShort":0,"unsignedByte":0,"unsignedLong":0,"unsignedInt":0,"decimal":0,"boolean":0,"integer":0,"double":0,"float":0,"short":0,"byte":0,"long":0,"int":0,"QName":1,"string":1,"normalizedString":2,"dateTime":3,"date":4,"time":5};BiXsTypeConverter.getJsType=function(sXsType){switch(BiXsTypeConverter._types[sXsType]){case 0:return Number;case 1:case 2:return String;case 3:case 4:case 5:return Date;}
return String;};BiXsTypeConverter.getJsTypeName=function(sXsType){switch(BiXsTypeConverter._types[sXsType]){case 0:return"number";case 1:case 2:return"string";case 3:case 4:case 5:return"date";}
return"string";};BiXsTypeConverter.getJsValue=function(sValue,sXsType){if(sValue==null){if(BiXsTypeConverter._types[sXsType]==null||BiXsTypeConverter._types[sXsType]==1)
return"";return null;}
switch(BiXsTypeConverter._types[sXsType]){case 0:if(sValue=="INF")
return Infinity;if(sValue=="-INF")
return-Infinity;return Number(sValue);case 1:case 2:return sValue;case 3:return BiXsTypeConverter.decodeIsoDateTime(sValue);case 4:return BiXsTypeConverter.decodeIsoDate(sValue);case 5:return BiXsTypeConverter.decodeIsoTime(sValue);}
return sValue;};BiXsTypeConverter.decodeIsoDateTime=function(s){var parts=s.split("T");var d=new Date;if(parts.length>0){BiXsTypeConverter._decodeIsoDate(d,parts[0]);if(parts.length>1)
BiXsTypeConverter._decodeIsoTime(d,parts[1]);}
return d;};BiXsTypeConverter.decodeIsoDate=function(s){var d=new Date;BiXsTypeConverter._decodeIsoDate(d,s);return d;};BiXsTypeConverter.decodeIsoTime=function(s){var d=new Date;BiXsTypeConverter._decodeIsoTime(d,s);return d;};BiXsTypeConverter._decodeIsoDate=function(d,s){d.setFullYear(s.substr(0,4));d.setMonth(s.substr(5,2)-1);d.setDate(s.substr(8,2));s=s.substr(10);var i=s.indexOf("+");if(i<0)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -