Hi,
We have decided to use a custom way of creating and showing recurrence appointments.
Now i would like to know how i can show the recurrence image in the appointment.
Is there a way to get the image from the scheduler so i can add it to the appointment template in the timeslotcreated event.
We are using the following code to show the appointment:
We have decided to use a custom way of creating and showing recurrence appointments.
Now i would like to know how i can show the recurrence image in the appointment.
Is there a way to get the image from the scheduler so i can add it to the appointment template in the timeslotcreated event.
We are using the following code to show the appointment:
function TimeSlotCreated(sender, e) { |
var app = e.get_appointment(); |
var element = e.get_appointment().get_element(); |
var attributeCollection = app.get_attributes(); |
var StateIconName = attributeCollection.getAttribute("StateIconName"); |
var SubStateIconName = attributeCollection.getAttribute("SubStateIconName"); |
var RsCategory = RgbStringToRadStyleString(attributeCollection.getAttribute("Color")); |
var customerName = attributeCollection.getAttribute("CustomerName"); |
var startTime = app.get_start().format("MMM dd, yyyy HH:mm:ss"); |
attributeCollection.setAttribute("OriginalStartTime", startTime); |
// Set the stateimage |
var image = document.createElement("img"); |
image.setAttribute("src", '/Images/16x16/icons/' + StateIconName); |
image.setAttribute("alt", 'IconImage'); |
image.setAttribute("ondragstart", 'javascript:return false;'); |
// If the appointment has a substate then show the substateimage |
if (SubStateIconName != null) { |
var image2 = document.createElement("img"); |
image2.setAttribute("src", '/Images/16x16/icons/' + SubStateIconName); |
image2.setAttribute("alt", 'IconImage'); |
image2.setAttribute("ondragstart", 'javascript:return false;'); |
} |
app.set_cssClass("rsCategory" + RsCategory); |
// All appointments with ID 0 are script generated, they are not actually appointments within the database, thus must not be allowed to |
// be edited/moved or resized in any way shape or form. |
if (app.get_id() == 0) { |
app.set_allowDelete(false); |
app.set_allowEdit(false); |
} |
var divs = element.getElementsByTagName('div'); |
var result; |
var innerHTML; |
for (i = 0; i < divs.length; i++) { |
// IE and its eternal spacing issues *sigh* |
if ($telerik.$(divs[i]).is("div.rsAptContent")) { |
result = divs[i]; |
innerHTML = result.innerHTML; |
result.innerHTML = ''; |
result.appendChild(image); |
// If the appointment has a substate then show the substateimage |
if (SubStateIconName != null) { result.appendChild(image2); } |
resultresult.innerHTML = result.innerHTML + innerHTML; |
resultresult.innerHTML = result.innerHTML + "<br />"; |
AddTargetControl(app); |
} |
} |
} |