Alex D. schrieb:
> 
>>> Hi list,
>>> i use treefullcontrol in my app. and it has a few "columns"(images as 
>>> well as text) to display some status information of the tree 
>>> folders/files. I become my status info from the backend approx. 5 times 
>>> per minute so i have to update my tree(mainly columns text/image - 
>>> rarely folder/files) and i'm searching for the efficient way to do this. 
>>> The brutal way is to delete the tree and build it again, but it costs to 
>>> much CPU resources and can take some seconds. So i'm looking for a 
>>> better way to update my treefullcontrol.
>>>
>>> Any help is appreciated,
>>>     
>>
>>
>> You have to "find" the widgets in your tree. Then, setIcon is an easy task.
>>
>> 1. add to your TreeFolder-Objects an unique Name as pathpart
>> 2. run every level to find the specific item (see code)
>> 3. item.setIcon(...), qx.ui.core.Widget.flushGlobalQueues();
>>
>> Tip: Do not add and remove treeitems without flush the queues, there is
>> an error in the qooxdoo class qx.core.Parent.
>>
>> Bye, Christian.
>>
>>   
> Thank you for your help, Christian. The idea with subpath looks rather
> elegant(i solved this by adding a unique id to all tree-nodes and
> recursive going through the tree until i find the node with the right
> one). Subpath solution should be quicker.

If your subtree's are sorted, you can find the rigth child in log(n,2)
steps instead running the complete child list.

If your tree is too big, you can cache all references to the treeItems
in a separate object and access it with your unique id.

> My second problem is "setIcon". I'm not sure how to do this, because my
> node rows has a few columns like:
>   +Folder           statusImage1     infoText1     statusImage2   infoText2
>       |
>       --File           statusImage1     infoText1     statusImage2  
> infoText2
> 
> and i don't really know how to replace infoText or statusImage in the
> File/Folder without deleting them. Or is it better to remove the node,
> build it again and add at current position?

What for an widget is these line? Find the instance variable/property
and change it directly. Remove/Add would be to expensive and I dont know
what qooxdoo/js do with 5 updates per minute with the garbage collection.

Bye, Christian.
-- 
Christian Harms
Softwareentwicklung - Online Services

Brauerstraße 48 · D-76135 Karlsruhe
Tel. +49-721-91374-4821 · Fax +49-721-91374-2740
[EMAIL PROTECTED] - http://web.de/

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to