Quote:
Originally Posted by sposetti 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).