- Home
- Forum
- JavaScript - EJ 2
- Week View timeScale enable=false not showing appointments
Week View timeScale enable=false not showing appointments
I'm trying to show the appointments in Week View by setting the timeScale enable = false, but only show with enable = true.
See the code:
var data =
"[{"my_name":"Mono Nomo Nono","StartTime":"2019-04-30T08:30:00","EndTime":"2019-04-30T08:35:00"},{"my_name":"Mono Nomo Nono Momo","StartTime":"2019-04-30T08:45:00","EndTime":"2019-04-30T08:50:00"}]";
"[{"my_name":"Mono Nomo Nono","StartTime":"2019-04-30T08:30:00","EndTime":"2019-04-30T08:35:00"},{"my_name":"Mono Nomo Nono Momo","StartTime":"2019-04-30T08:45:00","EndTime":"2019-04-30T08:50:00"}]";
var scheduleObj = new ej.schedule.Schedule({
width: '100%',
selectedDate: actual_date,
timeScale: {
enable: false,
interval: 60,
slotCount: slotCount
},
showHeaderBar: true,
showTimeIndicator: true,
eventSettings: {
dataSource: data,
fields: {
subject: { name: 'my_name' }
}
},
views: viewsCollection,
currentView: currentView,
showQuickInfo: false,
editorTemplate: '#EventEditorTemplate',
allowKeyboardInteraction: false
}
SIGN IN To post a reply.
5 Replies
KK
Karthigeyan Krishnamurthi
Syncfusion Team
May 7, 2019 11:06 AM UTC
Dear Customer,
Greetings from Syncfusion.
We checked the reported case and event is displaying without time scale.
Kindly try the sample and if the issue persists, try to reproduce the error in a sample and revert else share your values which are assigned to all variables like slotCount/runnable sample (if possible) to serve you better.
Regards,
Karthi
S_
S_Line
May 7, 2019 12:05 PM UTC
Thank you for your assistance.
My case, its that i have to get data from server each day, week, month change and append the schedule object to a div. So, when change the day or week, i'm going to server to get the data, destroy the schedule object, create a new one and append it again to a div.
In this scenario, with the timeScale = true, it works fine!
Is it the right way?
KK
Karthigeyan Krishnamurthi
Syncfusion Team
May 8, 2019 05:20 AM UTC
Dear Customer,
No, destroying the Schedule on navigation action is wrong as it affects the performance. By default, JS2 Scheduler works on load on demand concept where the post is raised for every CRUD and navigation action with the current view start and end date as parameter. In the below CRUD sample, LoadData will be called for every CRUD and navigation action.
|
public JsonResult LoadData(Params param) // Here we get the Start and End Date and based on that we can filter the data and return to Scheduler
{
DateTime start = DateTime.Parse(param.StartDate);
DateTime end = DateTime.Parse(param.EndDate);
var data = db.ScheduleEventDatas.Where(app => (app.StartTime >= start && app.StartTime <= end) || (app.RecurrenceRule != null && app.RecurrenceRule != "")).ToList(); // Here filtering the events based on the start and end date value.
return Json(data, JsonRequestBehavior.AllowGet);
}
public class Params
{
public string StartDate { get; set; }
public string EndDate { get; set; }
} |
Regards,
Karthi
S_
S_Line
May 8, 2019 11:05 AM UTC
Thank you!
I get a solution. Because i'm adding the schedule to a dynamic div, when i put this dynamic div in a body with:
var $div = $("<div>", { id: "schedule" });
$div.appendTo($("body"));
It works fine!
KK
Karthigeyan Krishnamurthi
Syncfusion Team
May 9, 2019 03:38 AM UTC
Dear Customer,
We are happy to hear that your issue is resolved.
Regards,
Karthi
SIGN IN To post a reply.
- 5 Replies
- 2 Participants
-
S_ S_Line
- May 6, 2019 02:02 PM UTC
- May 9, 2019 03:38 AM UTC