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
  #11 (permalink)  
Old 01-11-2010, 01:02 AM
Member
 
Posts: 14
Default

Quote:
Originally Posted by sposetti View Post
That's good to hear.

Can you post your code (the property/method you access) for reference in this thread?
No problem. My solution is a bit complicated though but it works so it's alright for me. If anybody knows a better (direct) way for getting ALL properties of a dragged task please just post here. I really don't know how to do it (maybe not all properties are there or I'm just not finding them).

So what I'm doing is, I'm querying all tasks once a task gets dragged on my zimlet, like this:
Code:
var cb = new AjxCallback(this, this._processSearchResponse);
var types = new AjxVector(); types.add("TASK");
appCtxt.getSearchController().search({query: "in:tasks", userText: true, types:types, limit:500, noRender:true, callback:cb});
Now inside the callback function I can get an array of all task-objects the response sends back:
Code:
var tasks = response.getResponse().getAttribute("task");
...and go through this array until I find the task that got dragged (obj.id is the id of the dragged task):
Code:
for (var i = 0; i < tasks.length; i++) {
   var currentTask = tasks[i];
   if (currentTask.id == obj.id) this._syncTask(currentTask, true);
}
Finally, this._syncTask is a method specific to my zimlet but it basically reads all the task-properties I need. The following properties are the ones I use (note that these are named differently).
  • currentTask.fr (= NOTES)
  • currentTask.dueDate (= endDate in milliseconds since 1/1/1970)
  • currentTask.dur (= duration in milliseconds)
  • currentTask.status
  • currentTask.percentComplete
  • currentTask.priority
  • currentTask.loc (= location)

It's all probably way too complicated but it's the only way I know right now to access ALL important properties of a dragged task (especially the notes).

Last edited by skid; 01-11-2010 at 01:08 AM..
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.