Appointments not displaying on CRUD

This seems to be an issue here before and I have tried all the solutions I could, such as    datamanager-does-not-show-items   where I used the excellent example as the basis of my project.

The DB is called, and the 3 sample appointments are returned.

public List<ScheduleData> GetData()
        {
            List<ScheduleData> data = _dbContext.ScheduleData.Take(500).ToList();
            return data;
        }
However the data is not being displayed on the screen via the

<e-datamanager url="Home/GetData" crud-url="Home/Batch" adaptor="UrlAdaptor"></e-datamanager>

It does show there is a duplication of ID with <ej-schedule id="Schedule1"  and e-appointment-settings apply-time-offset="false" id="Id" .

Here is my project if you want to check it out.

BTW you have a magnificent forum and help service, and I really love working with your tools.

Thanks









5 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team February 12, 2018 12:24 PM UTC

Hi Gary, 
 
Thank you for contacting Syncfusion support. 
 
We have checked your sample and corrected the below mistakes to display the appointments in Scheduler. Kindly download your modified sample from the following link. 

  1. In Layout file, jsrender.min is referred instead of jsrender and we have removed multiple references of script files.
  2. In index file, resource grouping option is used but in appointment collection (DB) no resource fields (RoomId, OwnerId) are included, kindly refer the below sample DB image.
 
 
 
  1. In index file, mapping fields are not correct with in e-appointment-settings, for example in DB, startTime field is used but it is mapped as StartTime in e-appointment-settings. Kindly refer the below link for your reference.

Regards, 
Karthigeyan 



GA Gary February 13, 2018 01:22 AM UTC

Thanks so much for your help in this, unfortunately despite the changes I don't see any change to the DB entries. They are being saved to the DB OK, however they never load to the schedule on load.

I am not sure what you meant by the mapping of the StartTime as startTime.
Both the ScheduleData.cs and the ScheduleData in the cal.db all have capital letters



Data is definitely being saved to the cal.db database.

Thanks again. :-)


Here is is coming back, so its just at the loading into the schedule thats missing



The data is getting into the DataSource property of the Schedule.





KK Karthigeyan Krishnamurthi Syncfusion Team February 13, 2018 04:48 PM UTC

Hi Gary, 

Thanks for your update. 

In the provided image, Start/EndTime field types are defined as text in ScheduleData table where as DateTime in ScheduleData.cs which could be the cause for the issue. In the below video demo, appointment field types are retrieved correctly at controller but while rendering in Schedule, fields are not mapped correctly, kindly ensure to choose the correct field type and values as shown below. As said earlier, in your sample resource grouping option is used but in ScheduleData table, no RoomId and OwnerId fields are defined which is also a cause for the appointment rendering issue.  


 

If still issue persist at your end, kindly share your DB appointment collection information to proceed further. 

Regards, 
Karthigeyan 
 



GA Gary February 13, 2018 09:56 PM UTC

Thanks again, for your great help, the examples and the videos are really high quality assistance, I really appreciate it.

I made the changes you showed and it worked. However I need the groupings, the rooms and the owners, and its become an either or situations, either I have groups, which I need, and I don't get appointments, or I have appointments and I don't have groups.

I have been using the code from the new Multiple Resource Grouping page. This seems to be the issue, Grouping is conflicting with Appointments.

I have reverted to  Multiple Resource    and find the same issue, if the resources are omitted from the view then we get appointments, add in resources and they don't work. 

Project has been uploaded to Github. Here is my project if you want to check it out. 
Its a bit messy as I am still debugging it.

You guys are amazing, I really appreciate your help :-)

Gary



KK Karthigeyan Krishnamurthi Syncfusion Team February 14, 2018 04:50 PM UTC

Hi Gary,  

Thanks for your update.  

In your sample, RoomId and OwnerId fields are used in appointment collection but no value is assigned and those fields are not mapped with in e-appointment-settings which is the cause for the issue. We have prepared the sample for your reference which can be download from the below location. 

<Code> 
<ej-schedule id="Schedule1" width="100%" height="525px" orientation="Horizontal" current-view="Month"  current-date="new DateTime(2015, 11, 11)"> 
    <e-resources> 
        <e-resource field="RoomId" title="Room" name="Rooms" allow-multiple=false> 
            <e-resource-settings datasource="@ViewBag.RoomData" text="Text" id="Id" group-id="GroupId" color="Color"></e-resource-settings> 
        </e-resource> 
        <e-resource field="OwnerId" title="Owner" name="Owners" allow-multiple=true> 
            <e-resource-settings datasource="@ViewBag.OwnerData" text="Text" id="Id" group-id="GroupId" color="Color"></e-resource-settings> 
        </e-resource> 
    </e-resources> 
    <e-appointment-settings apply-time-offset="false" id="Id" subject='"Subject"' start-time='"StartTime"' end-time='"EndTime"' all-day='"AllDay"' recurrence='"Recurrence"' recurrence-rule='"RecurrenceRule"' resource-fields='"RoomId,OwnerId"'> 
        <e-datamanager url="Home/GetData" crud-url="Home/Batch" adaptor="UrlAdaptor"></e-datamanager> 
    </e-appointment-settings> 
</ej-schedule> 
 
List<ResourceFields> Rooms = new List<ResourceFields>(); 
Rooms.Add(new ResourceFields { Text = "ROOM 1", Id = "1", Color = "#cb6bb2" }); 
Rooms.Add(new ResourceFields { Text = "ROOM 2", Id = "2", Color = "#56ca85" }); 
List<ResourceFields> Owners = new List<ResourceFields>(); 
Owners.Add(new ResourceFields { Text = "Ultimate 1", Id = "2", GroupId = "1", Color = "#f8a398" }); 
Owners.Add(new ResourceFields { Text = "Ultimate 2", Id = "3", GroupId = "2", Color = "#7499e1" }); 
Owners.Add(new ResourceFields { Text = "Ultimate 3", Id = "5", GroupId = "1", Color = "#f8a398" }); 
ViewBag.Grouping = new List<String>() { "Rooms", "Owners" }; 
ViewBag.RoomData = Rooms; 
ViewBag.OwnerData = Owners; 
 
public class ResourceFields 
{ 
    public string Text { set; get; } 
    public string Id { set; get; } 
    public string GroupId { set; get; } 
    public string Color { set; get; } 
 
} 
</Code> 


 

 

Note: In your sample still some fields like start/end time, id, etc.. are assigned as small letters as shown in the below video demo whereas in the above sample fields are retrieved correctly. After running the above project, appointment rendered in Schedule can be seen by using the below code in console window. 

<Code> 
var Obj = $("#Schedule1").data("ejSchedule"); 
Obj._currentAppointmentData 
</Code> 
 
Regards, 
Karthigeyan 


Loader.
Up arrow icon