Hi Fanisa,
Thanks for contacting Syncfusion support.
We have analyzed your requirements and understood that you want to disable the “allDay row and display the appointments without stretching”, which can be achieved by diabling the TimeScale Property. Please find the following code example to disable the TimeScale.
<Code>
@(Html.EJ().Schedule("Schedule1")
.Width("100%")
.Height("525px")
.TimeMode(Syncfusion.JavaScript.TimeMode.Hour12)
.CurrentDate(new DateTime(2014,6,2))
.ShowTimeScale(false)
</code>
We have prepared the sample with the above code example, which can be downloaded from the following location,
http://www.syncfusion.com/downloads/support/forum/121283/ze/TimeScale-1462087492
In the above sample, the allday row will not be displayed in all the views, also the appointment will be displayed in same height for all time intervals.
Note: If we had misunderstood your requirement, kindly let us know what you mean by startdate cell and how do you expect to fit the appointment in that. Also, please share the screenshot, if possible, to analyse those scenarios and provide the possible solution.
Regards,
Velmurugan
From: Shendelana, Fanisa
Sent: Friday, January 29, 2016 6:27 AM
To: Syncfusion Support <support@syncfusion.com>
Subject: RE: Syncfusion support community forum 121283, Shedule template, has been updated.
Hi your solution didn’t work for this,
Instead, it hides all the appointments as they are in the allday field in week view.
How do I make it appear like this as per your sample:
@(Html.EJ().Schedule("Schedule1")
.Width("100%")
.Height("525px")
.TimeMode(Syncfusion.JavaScript.TimeMode.Hour12)
.CurrentDate(new DateTime(2014, 6, 2))
.CurrentView(CurrentView.Day)
.ScheduleClientSideEvents(eve => eve.Navigation("OnNavigation").Create("OnCreate").ActionComplete("SetAllDayAppointmentWidth").AppointmentSaved("OnAppointmentSave"))
.AppointmentSettings(fields => fields.Datasource(Model)
.Id("Id")
.Subject("Subject")
.StartTime("StartTime")
.EndTime("EndTime")
.AllDay("AllDay")
.Recurrence("Recurrence")
.RecurrenceRule("RecurrenceRule"))
)
<script type="text/javascript">
function OnNavigation(args) { // This block code will execute to meet your requirement "hide allday row"
if (args.currentView == "week")
$("#Schedule1").ejSchedule({ showAllDayRow: false }); // Here we are hiding the allday row only for the week view
else
$("#Schedule1").ejSchedule({ showAllDayRow: true }); // Here we are showing the allday row for the day, workweek views
}
function OnCreate() {
$(".e-appointment").css("height", $(".e-workcells").height() - 1); // Here we are setting the height value for the initial rendering
}
function SetAllDayAppointmentWidth(args) {
if (args.model.currentView == "day")
$(".e-alldayappointment").css("width", $(".e-alldaycells").width() - 1); // Here we are setting the allday appointment width for day view display
else if (args.model.currentView == "month")
$(".e-monthappointment").css("width", $(".e-monthcells").width() - 1);
else
$(".e-alldayappointment").css("width", $(".e-alldaycells").width() - 1); // Here we are setting the allday appointment width for week and workweek views display
$(".e-appointment").css("height", $(".e-workcells").height() - 1);
}
function OnAppointmentSave(args) { // This block code example will used to meet your requirement while creating multi day appointment
var appStatus = args.appointment.EndTime.getDate() > args.appointment.StartTime.getDate() ? true : false;
if (appStatus) {
args.cancel = true;
var schObj = $("#Schedule1").data("ejSchedule");
var obj = {},temp=0;
obj["Subject"] = args.appointment.Subject;
obj["StartTime"] = args.appointment.StartTime;
temp = new Date(args.appointment.StartTime);
obj["EndTime"] = new Date(temp.setMinutes(temp.getMinutes() + 30));
schObj.saveAppointment(obj);
}
}
</script>
</code>
Note: If the above solution doesn’t meet your requirement or still we have misunderstood your requirement, kindly let us know what you mean by startdate cell and how do you expect to fit the appointment in that. Also, please share the screenshots that shows your requirement clearly if possible or details of the issue if you are facing anything. So, that we can analyze your requirements and provide you the possible solution.
Regards,
Velmurugan
<style>
.e-appointment {
height: 19px !important;
}
</style>
</code>
We have also included the CRUD operation code example in the above sample to display the appointment properly while performing the create, update and delete, as we have found that you have enabled the “LoadOnDemand” in your application(as per your code example).
Please try the above sample, if you face any issues, revert by reproducing the issue in the above sample or share the following information with us, so that we can analyze those scenarios and provide you the possible solution.