Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Zimlets

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-14-2009, 12:54 AM
Senior Member
 
Posts: 65
Default what zimbra call function when click on folders list

when I click on folders list at the left side (ex : Indox,sent,draft,...)
I want to create zimlet which alert folder name.

I know I can call this function

initializeToolbar ---> was called when init toolbar
onMsgView ---> was called when click on message
onShowView ---> was called when screen change

but about function onclick I have no idea.

Please let me know.
How I do?

Thank you for reply.
Reply With Quote
  #2 (permalink)  
Old 05-14-2009, 03:46 PM
Intermediate Member
 
Posts: 15
Default

Attach a listener to the folder tree view, in your zimlet initialization:

Code:
FolderChange.prototype.init = function() {
    var treeView = appCtxt.getAppViewMgr().getCurrentViewComponent(ZmAppViewMgr.C_TREE).getTreeView(ZmId.ORG_FOLDER);
    if (treeView) {
        treeView.addSelectionListener(AjxCallback.simpleClosure(this.folderChangeAlert, this));
    }
};
then your listener function can extract the folder name from the event:

Code:
FolderChange.prototype.folderChangeAlert = function(ev) {
    if (ev.items.length == 1 && ev.detail == DwtTree.ITEM_SELECTED) {
        var treeItem = DwtControl.getTargetControl(ev, false);
        var folder = treeItem.getData(Dwt.KEY_OBJECT);
        this.displayStatusMessage("Switched to " + folder.name);
    }
};
Reply With Quote
  #3 (permalink)  
Old 05-17-2009, 10:33 PM
Senior Member
 
Posts: 65
Default

Thank you very much...
^ ^
Reply With Quote
  #4 (permalink)  
Old 05-17-2009, 10:34 PM
Senior Member
 
Posts: 65
Default

Thank you very much
^ ^
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.