To support drag-n-drop for something other than contacts, make the following changes:
1. In the Zimlet Definition File (net_inova_gamps.xml), you have:
Code:
<dragSource type="ZmAppointment" >
This should be:
Code:
<dragSource type="ZmAppt" >
2. In your Zimlet Handler Object
Code:
Net_Inova_GMaps.prototype.doDrop()
method, you'll want to check for "type" to retrieve info from the contact or appointment (based on what is dropped). Here is an example of retrieving various properties from an appointment and from a contact:
Code:
Net_Inova_GMaps.prototype.doDrop = function(obj, canvas) {
var type = obj.TYPE;
switch(type) {
case "ZmAppt": {
// do something with ZmAppt
var apt = obj.srcObj; // {ZmAppt}
var aptName = apt.getName(); // get name (i.e. "subject") {String}
var aptNotes = apt.getNotesPart(); // {String}
var location = apt.getLocation(); // {String}
var startTime = apt.getStartTime(); // {int} milliseconds
var endTime = apt.getEndTime(); // {int} milliseconds
var dateRange = apt.getDateRange(); // dateRange.startTime + dateRange.endTime {Date}
var allDayEvent = apt.allDayEvent; // {String} "0" "1"
var freeBusy = apt.freeBusy; // {String} "B" "T" "O" "F"
var privacy = apt.privacy; // {String} "PRI" "PUB"
if (isRecurring) {
var recObj = apt._recurrence; // {ZmRecurrence}
var blurb = apt.getRecurBlurb(); // {String}
var type = apt.getRecurType(); // {String}
}
break;
}
case "ZmContact": {
// do something with ZmContact
var contact = obj; // {ZmContact}
var fn = contact.firstName; // {String}
var ln = contact.lastName; // {String}
var email = contact.email; // {String}
var homePhone = contact.homePhone; // {String}
var otherPhone = contact.otherPhone; // {String}
var workPhone = contact.workPhone; // {String}
break;
}
} Also, there are other types supported for drop. See this example and the JsDoc for that method:
ZCS 6.0:Zimlet Developers Guide:Examples:Panel Item Drag Source - Zimbra :: Wiki Zimlet JavaScript API Reference - ZmZimletBase