flymis/WebRoot/dojojs/src/data/Result.js

(开头部分) 6KB

这里只显示每个文件的开头 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.Result");
dojo.require("dojo.lang.declare");
dojo.require("dojo.experimental");

/* summary:
 *   This is an abstract API used by data provider implementations.  
 *   This file defines methods signatures and intentionally leaves all the
 *   methods unimplemented.
 */
dojo.experimental("dojo.data.Result");

dojo.declare("dojo.data.Result", null, {
	forEach:
		function(/* function */ callbackFunction, /* object? */ callbackObject, /* object? */ optionalKeywordArgs) {
		/* summary:
		 *   Loops through the result list, calling a callback function
		 *   for each item in the result list.
		 * description:
		 *   The forEach() method will call the callback function once for 
		 *   each item in the result list.  The forEach() method will pass 
		 *   3 arguments to the callbackFunction: an item, the index of 
		 *   item in the context of this forEach() loop, and the result object
		 *   itself.  The signature of this forEach() method was modeled on
		 *   the forEach() method of Mozilla's Array object in JavaScript 1.6:
		 *   http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Objects:Array:forEach
		 *   The forEach() method will returns true if the entire result list 
		 *   has been looped through, or false if the result list has not yet
		 *   been looped through.
		 *   The forEach() method will ignore any return value returned by
		 *   the callbackFunction.
		 *   After the forEach() operation has finished (or been cancelled)
		 *   result.forEach() can be called again on the same result object.
		 * ISSUES -
		 *   We haven't yet decided what other parameters we might allow to
		 *   support fancy features.  Here are some ideas:
		 *     results.forEach({callback:callbackFunction, onCompletion: finishedFunction});
		 *     results.forEach({callback:callbackFunction, first: 201, last: 300}); // partial loop
		 *     results.forEach({callback:callbackFunction, first: 200, numItems: 50}); // partial loop from 200 to 250
		 *   CCM - How to specify datastore-specific options to allow caching n
		 *   items before/after current window of items being viewed?
		 * callbackObject:
		 *   If a callbackObject is provided the callbackFunction will be called
		 *   in the context of the callbackObject (the callbackObject will be 
		 *   used as the 'this' for each invocation of the callbackFunction).
		 *   If callbackObject is not provided, or is null, the global object
		 *   associated with callback is used instead.
		 * optionalKeywordArgs:
		 *   The forEach() method may accept a third parameter, which should be
		 *   an object with keyword parameters.  Different implementations may
		 *   make use of different keyword paramters.  Conforming 
后面还有 98 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。