flymis/WebRoot/dojojs/src/data/csv/CsvStore.js
(开头部分) 7KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.data.csv.CsvStore");
dojo.require("dojo.data.Read");
dojo.require("dojo.lang.assert");
dojo.declare("dojo.data.csv.CsvStore", dojo.data.Read, {
/* summary:
* The CsvStore implements the dojo.data.Read API.
*/
/* examples:
* var csvStore = new dojo.data.csv.CsvStore({url:"movies.csv");
* var csvStore = new dojo.data.csv.CsvStore({url:"http://example.com/movies.csv");
* var fileContents = dojo.hostenv.getText("movies.csv");
* var csvStore = new dojo.data.csv.CsvStore({string:fileContents);
*/
initializer:
function(/* object */ keywordParameters) {
// keywordParameters: {string: String, url: String}
this._arrayOfItems = [];
this._loadFinished = false;
this._csvFileUrl = keywordParameters["url"];
this._csvFileContents = keywordParameters["string"];
},
get:
function(/* item */ item, /* attribute or attribute-name-string */ attribute, /* value? */ defaultValue) {
// summary: See dojo.data.Read.get()
var attributeValue = item[attribute] || defaultValue;
return attributeValue; // a literal, an item, null, or undefined (never an array)
},
getValues:
function(/* item */ item, /* attribute or attribute-name-string */ attribute) {
// summary: See dojo.data.Read.getValues()
var array = [this.get(item, attribute)];
return array; // an array that may contain literals and items
},
getAttributes:
function(/* item */ item) {
// summary: See dojo.data.Read.getAttributes()
var array = this._arrayOfKeys;
return array; // array
},
hasAttribute:
function(/* item */ item, /* attribute or attribute-name-string */ attribute) {
// summary: See dojo.data.Read.hasAttribute()
for (var i in this._arrayOfKeys) {
if (this._arrayOfKeys[i] == attribute) {
return true;
}
}
return false; // boolean
后面还有 160 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。