This is a migrated thread and some comments may be shown as answers.

Show recurring image (not using standard recurrence)

1 Answer 90 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Datamex
Top achievements
Rank 2
Datamex asked on 24 Sep 2009, 08:33 AM
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:

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);  
        }  
      }  
    } 

1 Answer, 1 is accepted

Sort by
0
Accepted
Peter
Telerik team
answered on 26 Sep 2009, 09:26 AM
Hi,

We use a sprite image to style the appointments. The sprite image contains the recurrence icon and can be found at:
[your local installation of the Telerik.Web.UI suite]\Skins\[SkinName]\Scheduler->rsSprites.png

In your case it would be better to simply cut the recurrence icon and use it independently from the entire sprite image.


Regards,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Scheduler
Asked by
Datamex
Top achievements
Rank 2
Answers by
Peter
Telerik team
Share this question
or