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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Week View timeScale enable=false not showing appointments

Thread ID:

Created:

Updated:

Platform:

Replies:

144432 May 6,2019 02:02 PM UTC May 9,2019 03:38 AM UTC JavaScript - EJ 2 5
loading
Tags: Schedule
S_Line
Asked On May 6, 2019 02:02 PM UTC

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"}]";

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
}



Karthigeyan Krishnamurthi [Syncfusion]
Replied On 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_Line
Replied On 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?

Karthigeyan Krishnamurthi [Syncfusion]
Replied On 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_Line
Replied On 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!

Karthigeyan Krishnamurthi [Syncfusion]
Replied On May 9, 2019 03:38 AM UTC

Dear Customer,  
 
We are happy to hear that your issue is resolved. 
 
Regards, 
Karthi 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon