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

📄 read.js

📁 这是一个ajax的例子大家好好的看看就是一个鱼眼的效果
💻 JS
📖 第 1 页 / 共 2 页
字号:
if(!dojo._hasResource["dojo.data.api.Read"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.dojo._hasResource["dojo.data.api.Read"] = true;dojo.provide("dojo.data.api.Read");dojo.require("dojo.data.api.Request");dojo.declare("dojo.data.api.Read", null, {	//	summary:	//		This is an abstract API that data provider implementations conform to.  	//		This file defines methods signatures and intentionally leaves all the	//		methods unimplemented.  For more information on the dojo.data APIs, 	//		please visit: http://www.dojotoolkit.org/node/98	getValue: function(	/* item */ item, 						/* attribute-name-string */ attribute, 						/* value? */ defaultValue){		//	summary:		//		Returns a single attribute value.		//		Returns defaultValue if and only if *item* does not have a value for *attribute*.		//		Returns null if and only if null was explicitly set as the attribute value.		//		Returns undefined if and only if the item does not have a value for the		//		given attribute (which is the same as saying the item does not have the attribute). 		// description:		//		Saying that an "item x does not have a value for an attribute y"		//		is identical to saying that an "item x does not have attribute y". 		//		It is an oxymoron to say "that attribute is present but has no values" 		//		or "the item has that attribute but does not have any attribute values".		//		If store.hasAttribute(item, attribute) returns false, then		//		store.getValue(item, attribute) will return undefined.		//		//	item:		//		The item to access values on.		//	attribute:		//		The attribute to access represented as a string.		//	defaultValue:		//		Optional.  A default value to use for the getValue return in the attribute does not exist or has no value.		//		//	exceptions:		//		Throws an exception if *item* is not an item, or *attribute* is not a string		//	example:		//	|	var darthVader = store.getValue(lukeSkywalker, "father");		var attributeValue = null;		throw new Error('Unimplemented API: dojo.data.api.Read.getValue');		return attributeValue; // a literal, an item, null, or undefined (never an array)	},	getValues: function(/* item */ item,						/* attribute-name-string */ attribute){		//	summary:		// 		This getValues() method works just like the getValue() method, but getValues()		//		always returns an array rather than a single attribute value.  The array		//		may be empty, may contain a single attribute value, or may contain		//		many attribute values.		//		If the item does not have a value for the given attribute, then getValues()		//		will return an empty array: [].  (So, if store.hasAttribute(item, attribute)		//		has a return of false, then store.getValues(item, attribute) will return [].)		//		//	item:		//		The item to access values on.		//	attribute:		//		The attribute to access represented as a string.		//		//	exceptions:		//		Throws an exception if *item* is not an item, or *attribute* is not a string		//	example:		//	|	var friendsOfLuke = store.getValues(lukeSkywalker, "friends");		var array = [];		throw new Error('Unimplemented API: dojo.data.api.Read.getValues');		return array; // an array that may contain literals and items	},	getAttributes: function(/* item */ item){		//	summary:		//		Returns an array with all the attributes that this item has.  This		//		method will always return an array; if the item has no attributes		//		at all, getAttributes() will return an empty array: [].		//		//	item:		//		The item to access attributes on.		//		//	exceptions:		//		Throws an exception if *item* is not an item, or *attribute* is not a string		//	example:		//	|	var array = store.getAttributes(kermit);		var array = [];		throw new Error('Unimplemented API: dojo.data.api.Read.getAttributes');		return array; // array	},	hasAttribute: function(	/* item */ item,							/* attribute-name-string */ attribute){		//	summary:		//		Returns true if the given *item* has a value for the given *attribute*.		//		//	item:		//		The item to access attributes on.		//	attribute:		//		The attribute to access represented as a string.		//		//	exceptions:		//		Throws an exception if *item* is not an item, or *attribute* is not a string		//	example:		//	|	var trueOrFalse = store.hasAttribute(kermit, "color");		throw new Error('Unimplemented API: dojo.data.api.Read.hasAttribute');		return false; // boolean	},	containsValue: function(/* item */ item,							/* attribute-name-string */ attribute, 							/* anything */ value){		//	summary:		//		Returns true if the given *value* is one of the values that getValues()		//		would return.		//		//	item:		//		The item to access values on.		//	attribute:		//		The attribute to access represented as a string.		//	value:		//		The value to match as a value for the attribute.		//		//	exceptions:		//		Throws an exception if *item* is not an item, or *attribute* is not a string		//	example:		//	|	var trueOrFalse = store.containsValue(kermit, "color", "green");		throw new Error('Unimplemented API: dojo.data.api.Read.containsValue');		return false; // boolean	},	isItem: function(/* anything */ something){		//	summary:		//		Returns true if *something* is an item and came from the store instance.  		//		Returns false if *something* is a literal, an item from another store instance, 		//		or is any object other than an item.		//		//	something:		//		Can be anything.		//		//	example:		//	|	var yes = store.isItem(store.newItem());		//	|	var no  = store.isItem("green");		throw new Error('Unimplemented API: dojo.data.api.Read.isItem');		return false; // boolean	},	isItemLoaded: function(/* anything */ something) {		//	summary:		//		Returns false if isItem(something) is false.  Returns false if		//		if isItem(something) is true but the the item is not yet loaded		//		in local memory (for example, if the item has not yet been read		//		from the server).		//		//	something:		//		Can be anything.		//		//	example:		//	|	var yes = store.isItemLoaded(store.newItem());		//	|	var no  = store.isItemLoaded("green");		throw new Error('Unimplemented API: dojo.data.api.Read.isItemLoaded');		return false; // boolean	},	loadItem: function(/* object */ keywordArgs){		//	summary:		//		Given an item, this method loads the item so that a subsequent call		//		to store.isItemLoaded(item) will return true.  If a call to		//		isItemLoaded() returns true before loadItem() is even called,		//		then loadItem() need not do any work at all and will not even invoke		//		the callback handlers.  So, before invoking this method, check that		//		the item has not already been loaded.  		// 	keywordArgs:		//		An anonymous object that defines the item to load and callbacks to invoke when the 		//		load has completed.  The format of the object is as follows:		//		{		//			item: object,		//			onItem: Function,		//			onError: Function,		//			scope: object		//		}		//	The *item* parameter.		//		The item parameter is an object that represents the item in question that should be		//		contained by the store.  This attribute is required.				//	The *onItem* parameter.		//		Function(item)		//		The onItem parameter is the callback to invoke when the item has been loaded.  It takes only one		//		parameter, the fully loaded item.		//		//	The *onError* parameter.		//		Function(error)		//		The onError parameter is the callback to invoke when the item load encountered an error.  It takes only one		//		parameter, the error object		//		//	The *scope* parameter.		//		If a scope object is provided, all of the callback functions (onItem, 		//		onError, etc) will be invoked in the context of the scope object.		//		In the body of the callback function, the value of the "this"		//		keyword will be the scope object.   If no scope object is provided,		//		the callback functions will be called in the context of dojo.global().		//		For example, onItem.call(scope, item, request) vs. 		//		onItem.call(dojo.global(), item, request)		if (!this.isItemLoaded(keywordArgs.item)) {			throw new Error('Unimplemented API: dojo.data.api.Read.loadItem');		}	},	fetch: function(/* Object */ keywordArgs){		//	summary:		//		Given a query and set of defined options, such as a start and count of items to return,		//		this method executes the query and makes the results available as data items.		//		The format and expectations of stores is that they operate in a generally asynchronous 		//		manner, therefore callbacks are always used to return items located by the fetch parameters.		//		//	description:		//		A Request object will always be returned and is returned immediately.		//		The basic request is nothing more than the keyword args passed to fetch and 		//		an additional function attached, abort().  The returned request object may then be used 		//		to cancel a fetch.  All data items returns are passed through the callbacks defined in the 		//		fetch parameters and are not present on the 'request' object.		//		//		This does not mean that custom stores can not add methods and properties to the request object		//		returned, only that the API does not require it.  For more info about the Request API, 		//		see dojo.data.api.Request		//		//	keywordArgs:		//		The keywordArgs parameter may either be an instance of 		//		conforming to dojo.data.api.Request or may be a simple anonymous object		//		that may contain any of the following:		//		{ 		//			query: query-object or query-string,		//			queryOptions: object,		//			onBegin: Function,		//			onItem: Function,		//			onComplete: Function,		//			onError: Function,		//			scope: object,		//			start: int		//			count: int		//			sort: array		//		}		//		All implementations should accept keywordArgs objects with any of		//		the 9 standard properties: query, onBegin, onItem, onComplete, onError 		//		scope, sort, start, and count.  Some implementations may accept additional 		//		properties in the keywordArgs object as valid parameters, such as 		//		{includeOutliers:true}.         		//		//	The *query* parameter.		//		The query may be optional in some data store implementations.		//		The dojo.data.api.Read API does not specify the syntax or semantics		//		of the query itself -- each different data store implementation		//		may have its own notion of what a query should look like.		//		However, as of dojo 0.9, 1.0, and 1.1, all the provided datastores in dojo.data		//		and dojox.data support an object structure query, where the object is a set of 		//		name/value parameters such as { attrFoo: valueBar, attrFoo1: valueBar1}.  Most of the		//		dijit widgets, such as ComboBox assume this to be the case when working with a datastore 

⌨️ 快捷键说明

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