We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

EJ:Schedule - QueryCellInfo Args to Access Appointment

Hello,

Is there a way to directly access an appointment's properties when performing the JavaScript function for QueryCellInfo? I can change all appointment elements during the event, but I would like to decide specific formatting for appointments as determined by their properties.

Pseudo-code (DOES NOT WORK!)
<script>
function QueryCellInfo(args)
{
switch (args.requestType)
{
case "appointment":
if (args.appointment.Subject == "Meeting")
{
// style appointment
}
break;
}
}
</script>

Please and thanks,
Matt

1 Reply

SE Sellakumar Syncfusion Team March 13, 2017 12:41 PM UTC

Hi Matt,   
 
Thanks for contacting Syncfusion support.   
 
As per your requirement, we suggest you to maintain a custom field in an appointment object. Based on this custom field value, we can customize the element inside QueryCellInfo event. The below code explains to maintain custom fields in object.   
   
In Appointment Object:   
 
<Code>   
   
new SampleData {    
                Id = 1 ,    
                Subject = "Turtle Walk"   
                Description = "Night out with turtles"   
                StartTime = new DateTime(2017, 3, 6, 5, 30, 0),    
                EndTime = new DateTime(2017, 3, 6, 7, 30, 0),    
                AllDay = false   
                Recurrence = false   
                QueryCellType = "Admin"    
           },   
   
</Code>   
   
In QueryCellInfo Event:   
   
<Code>   
   
         <script type="text/javascript">   
        function onQueryCellInfo(args) {   
            if (args.requestType == "appointment") {   
                if (args.appointment.QueryCellType == "Admin") {   
                    args.element.css({ background: "green" });   
                }   
                else {   
                    args.element.css({ background: "lightgreen" });   
                }   
   
            }   
        }   
    </script>   
   
</Code>   
   
We had prepared a sample based on your requirement, which can be download from following location.   
   
   
Kindly check the above sample and revert us with further details, if we have misunderstood your requirement.   
   
Regards,   
Sellakumar K  

Loader.
Live Chat Icon For mobile
Up arrow icon