changing month appointment text style

In the month view of the schedule, I would like to add a line-through on the text for the specific appointments with a certain value.  Not the popup that comes up after you click the appointment, but just as the appointment appears on the schedule.


Thanks

3 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team October 15, 2018 05:12 AM UTC

Hi Anthony 
 
Thank you for contacting Syncfusion support. 
 
We can customize the appointment text using QueryCellEvent event and for the same we have prepared the below sample for your reference. In the below sample, line-through CSS is applied only to Saturday appointments subject. 
 
queryCellInfo: "textCustomization", 
 
function textCustomization(args) { 
            if (args.requestType == "appointment" && args.model.currentView == "month") { 
                if (args.appointment.StartTime.getDay() == 6) { 
                    var textDiv = args.element.find(".e-apptext"); 
                    textDiv.css("text-decoration", "line-through"); 
                } 
            } 
        } 
 
Note: Above sample is made in JS for your reference and the same can be achieved in MVC too. 
 
Regards, 
Karthigeyan 
 
 



AT Anthony Tran - NO LONGER THERE October 15, 2018 07:49 PM UTC

Thank you, this solution works.

One other thing, I'm working through filtering appointments on the schedule.  I've gotten to the point where I have the filtered appointments, but the demo on site doesn't show how to load the schedule with the filtered appointments.  Any assistance with this?


KK Karthigeyan Krishnamurthi Syncfusion Team October 16, 2018 04:39 AM UTC

Hi Anthony, 
 
Thanks for your update. 
 
We can update the Scheduler data source with its instance and for the same we have prepared the below sample. Initially, Schedule is rendered with empty data source and when the button is clicked, new collection is assigned to the Scheduler as shown below. 
 
<input type="button" id="setDT" onclick="test()" value="Click Here" /> 
 
function test() { 
            var dManager = [{ 
                Id: 109, 
                Subject: "Bering Sea Gold", 
                StartTime: new Date(2014, 4, 6, 11, 00), 
                EndTime: new Date(2014, 4, 6, 13, 00), 
                Description: "", 
                AllDay: false, 
                Recurrence: false 
            }]; 
            var scheduleObj = $("#Schedule1").data("ejSchedule"); 
            scheduleObj.option("appointmentSettings.dataSource", dManager); 
        } 
 
Note: Above sample is made in JS for your reference and the same can be achieved in MVC too.  
  
Regards,  
Karthigeyan  
 


Loader.
Up arrow icon