⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 arraydataset.js

📁 ajax 框价.是个好工具.javascript 矿家.可以用在任何平台.
💻 JS
字号:
///////////////////////////////////////////////////////////////////////////////// ArrayDataSet//// A basic implemention of a data set that takes a matrix (an array of arrays)// and names the columns "0", "1" and so onfunction ArrayDataSet( oArray, sName ){	BiDataSet.call( this, sName );	var t = new BiDataTable;	var rows = oArray.length;	var cols = rows > 0 ? oArray[0].length : 0;	if ( rows > 0 && cols > 0 )	{		var c;		// create colums		for ( var x = 0; x < cols; x++ )		{			c = new BiDataColumn( String(x) );			// will map to "data", "string", "number" but will also include "undefined"			c.setDataType( oArray[0][x] instanceof Date ? "date" : typeof oArray[0][x] );			t.addColumn( c );		}		for ( var y = 0; y < rows; y++ )			t.addRow( new ArrayDataRow( oArray[y] ) );	}	this.addTable( t );}_p = ArrayDataSet.prototype = new BiDataSet;_p._className = "ArrayDataSet";///////////////////////////////////////////////////////////////////////////////// ArrayDataRow//// A very basic implementation of a BiDataRow that uses an array for the data// and assumes the names of the columns are "0", "1", ...//// To use with ArrayDataSet but can be used with other data sets that follows// this conventionfunction ArrayDataRow( oArray ){	BiDataRow.call( this );	this._data = oArray;}_p = ArrayDataRow.prototype = new BiDataRow;_p._className = "ArrayDataRow";_p.getValueByIndex = function ( i ){	return this._data[ i ];};_p.getValueByName = function ( sName ){	return this._data[ Number( sName ) ];};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -