Stupid Zimlet Tricks -- Get your TreeItem in Zimlet

Revision as of 13:03, 24 March 2015 by Jorge de la Cruz (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

One of the features I really want is to have a user be able to drag their calender event, or email directly to a Treeitem, and have that be the only thing needed to add time to their project.

Unfortunitly this isn't documented inside of the zimlet specification. It is how the treeitem is grabbed internally in the ZimletBase class, but it probably is verboten. Use at your own risk.

This code is also important because it shows you how to get the context. That allows you to get very useful things like the user's username and primary email address.

   Org_Technicaldetails_Projects.prototype._getRootNode = function()
   {
 
       /// Note that the following code may suddenly combust into flames, 
       /// sparking a reaction that will end all life on earth. Not documented
       /// in the zimlet spec, so use at your own risk. 
 
        var appCtxt = this.getAppCtxt();
        var ctrl = appCtxt.getOverviewController();

        var treeView = ctrl.getTreeView(ZmZimbraMail._OVERVIEW_ID, ZmOrganizer.ZIMLET);
        _treeRootNode = treeView.getTreeItemById(this.xmlObj().getOrganizer().id);
        _treeRootNode.setText("This is my icon for my zimlet); 
   };
Jump to: navigation, search