> 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.

/**
 * Find in the qxTree the Folder-item pointed with subPath.
 *
 * @param {String} subPath  the subPath in the qxFolderTree
 * @param rootTree {Container-Object}
 * @param {Boolean} openOnTheFly
 * @return {qx.ui.treefullcontrol.FolderTree}
 */
qx.Proto._getQxSubTree = function(subPath, rootTree, openOnTheFly) {
    var pathList = subPath.split("/");
    var run = rootTree;

    for (var i=0; i<pathList.length; i++) {
        var childs = [];
        if (run.getContainerObject()){
            childs = run.getContainerObject().getChildren();
        }
        for (var j=0; j<childs.length; j++) {
            var item = childs[j];
            var usrData = item.getUserData('path_part');
            if (usrData == pathList[i]) {
                //this.debug("SearchOk: "+usrData);
                run = childs[j];
                if (openOnTheFly){
                    //... setSelectedElement doesn't do that.
                    run.open();
                }
                break;
            }
        }
    }
    return run;
};

-- 
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