Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

Appointment color when using webservice binding

$
0
0

Found out how to do it. :-)

When using webservice databinding, it needs to be done client-side with some jQuery templating engine, eg. like this:

functionwsOnSchedulerDataBound(scheduler) {
    $(".rsApt").each(function() {
        varl_oAppointment = scheduler.getAppointmentFromDomElement(this);
        varl_aAttr = l_oAppointment.get_attributes();
        varbgColor = l_aAttr.getAttribute('BgColor');
        l_oAppointment.set_backColor(bgColor);
    });
 
    $(".rsAptDelete").each(function() {
        varl_oAppointment = scheduler.getAppointmentFromDomElement(this);
        varl_aAttr = l_oAppointment.get_attributes();
        // creating an object containing the data that should be applied on the template
        varl_aValues = {
            NumberOfPlaces: l_aAttr.getAttribute('NumberOfPlaces'),
            TaskPoints: l_aAttr.getAttribute('TaskPoints'),
            AgeMin: l_aAttr.getAttribute('AgeMin'),
            AgeMax: l_aAttr.getAttribute('AgeMax'),
            Gender: l_aAttr.getAttribute('Gender')
        };
        // instantiate the template, populate it and insert before the delete handler (".rsAptDelete")
        $('<div></div>').loadTemplate("#tmplAppointmentData", l_aValues).insertBefore(this);
    });
};

Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>