Hi,

I extended QxTreeFolder for adding child when user expand a node. A event is fired once when the user click on collapsed button first time.


//----------------------------------------------
// QxDynamicTreeFolder
//----------------------------------------------

function QxDynamicTreeFolder(vLabel)
{
  QxTreeFolder.call(this, vLabel);
                
  this._expanded = false;
}
        
QxDynamicTreeFolder.extend(QxTreeFolder, "QxDynamicTreeFolder");
        
proto._modifyOpen = function(propValue, propOldValue, propData)
{
  if (!this._expanded)
  {
    this.createDispatchEvent("expand");
    this._expanded = true;
  }
                
return QxTreeFolder.prototype._modifyOpen.call(this, propValue, propOldValue, propData);
}


//----------------------------------------------
// example
//----------------------------------------------


function onExpand(e)
{
  for (var i = 0; i < 20;i++)
  {                             
    var f1 = new QxTreeFolder("SubFolder");
    e.getCurrentTarget().add(f1);
  }
}
                        
var df = new QxDynamicTreeFolder("DynamicFolder");
df.setAlwaysShowPlusMinusSymbol(true);
df.addEventListener("expand", onExpand);
                        

Stefano


Ricardo Borillo Domenech ha scritto:
Hi,

I make a "quick and dirty" test on these some days ago ...
My intention is to extend QxTreeFolder to handle reload (from
datasource) stuff.


I have a question: can I append elements to tree dynamically when the user click on the plus sign? In other word, I can force display of plus button even if node contains no children?

(for win32 programmers, this is similar to I_CHILDRENCALLBACK flag of TreeView control)


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to