X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=org.argeo.slc.webapp%2Fsrc%2Fmain%2Fwebapp%2Fargeo-ria-src%2Fclass%2Forg%2Fargeo%2Fria%2Fcomponents%2FDynamicTreeFolder.js;h=6841b700d748efedaf6dbecd41651b262eddc85c;hb=3e24f32c95b5ac3ec7fcae7000c4a8cfb857d514;hp=76509f3ef1f9400ff3756f8fc215fbe3aa733319;hpb=90d214e9301acfd75d29c9408aefc04d0fb8c12c;p=gpl%2Fargeo-slc.git diff --git a/org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/DynamicTreeFolder.js b/org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/DynamicTreeFolder.js index 76509f3ef..6841b700d 100644 --- a/org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/DynamicTreeFolder.js +++ b/org.argeo.slc.webapp/src/main/webapp/argeo-ria-src/class/org/argeo/ria/components/DynamicTreeFolder.js @@ -6,25 +6,45 @@ qx.Class.define("org.argeo.ria.components.DynamicTreeFolder", { extend : qx.ui.tree.TreeFolder, properties : { + /** + * The current state of the folder, usually "empty" => "loading" => "loaded" + */ "state" : { check : "String", init : "empty", apply : "_applyState" }, + /** + * String to display as a child node during loading + */ "loadingString" : { check : "String", init : "Loading..." }, + /** + * Function that will load the children of this folder + */ "loader" : { check : "Function", init : function(treeFolder){treeFolder.setLoaded();} }, + /** + * Optionnal data describing the "drag" behaviour of the created children. + * First level is "file" or "folder", and for each of them, supported keys are "type" and "action". + */ "dragData": { check : "Map", init : {} } }, + /** + * Creates a new instance of DynamicTreeFolder + * @param label {String} Label of the folder + * @param loader {Function} Function that will load the children + * @param loadingString {String} String to display as a child node during loading + * @param dragData {Map} Optionnal data describing the "drag" behaviour of the created children. + */ construct : function(label, loader, loadingString, dragData){ this.base(arguments, label); if(loader) this.setLoader(loader); @@ -39,7 +59,10 @@ qx.Class.define("org.argeo.ria.components.DynamicTreeFolder", { }, members : { - + /** + * Add an item to the folder + * @param varargs {Mixed} One or many children to add + */ add : function(varargs){ this.base(arguments, varargs); for (var i=0, l=arguments.length; i