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

📄 extras.js

📁 dojo与json创建无限级树的时候,当在父结点下添加了一个新结点,我怎么让父亲结点重新调用json加载一下子结点内容.
💻 JS
字号:
/*	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.lang.extras");dojo.require("dojo.lang.common");/** * Sets a timeout in milliseconds to execute a function in a given context * with optional arguments. * * setTimeout (Object context, function func, number delay[, arg1[, ...]]); * setTimeout (function func, number delay[, arg1[, ...]]); */dojo.lang.setTimeout = function(func, delay){	var context = window, argsStart = 2;	if(!dojo.lang.isFunction(func)){		context = func;		func = delay;		delay = arguments[2];		argsStart++;	}	if(dojo.lang.isString(func)){		func = context[func];	}		var args = [];	for (var i = argsStart; i < arguments.length; i++) {		args.push(arguments[i]);	}	return setTimeout(function () { func.apply(context, args); }, delay);}dojo.lang.getNameInObj = function(ns, item){	if(!ns){ ns = dj_global; }	for(var x in ns){		if(ns[x] === item){			return new String(x);		}	}	return null;}dojo.lang.shallowCopy = function(obj) {	var ret = {}, key;	for(key in obj) {		if(dojo.lang.isUndefined(ret[key])) {			ret[key] = obj[key];		}	}	return ret;}/** * Return the first argument that isn't undefined */dojo.lang.firstValued = function(/* ... */) {	for(var i = 0; i < arguments.length; i++) {		if(typeof arguments[i] != "undefined") {			return arguments[i];		}	}	return undefined;}/** * Get a value from a reference specified as a string descriptor, * (e.g. "A.B") in the given context. *  * getObjPathValue(String objpath [, Object context, Boolean create]) * * If context is not specified, dj_global is used * If create is true, undefined objects in the path are created. */dojo.lang.getObjPathValue = function(objpath, context, create){	with(dojo.parseObjPath(objpath, context, create)){		return dojo.evalProp(prop, obj, create);	}}/** * Set a value on a reference specified as a string descriptor.  * (e.g. "A.B") in the given context. *  * setObjPathValue(String objpath, value [, Object context, Boolean create]) * * If context is not specified, dj_global is used * If create is true, undefined objects in the path are created. */dojo.lang.setObjPathValue = function(objpath, value, context, create){	if(arguments.length < 4){		create = true;	}	with(dojo.parseObjPath(objpath, context, create)){		if(obj && (create || (prop in obj))){			obj[prop] = value;		}	}}

⌨️ 快捷键说明

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