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. Image for the cookie policy date
close icon

DataSource


Hello support: I am consuming a service through an HTTP request, It turns out that I call the service and filled an object with all the information it brings me, but at the time of assigning it to the EventSettingsModel I do not get any data, I passed to the datasource and It brings me all the service and paints it in the scheduler, but when I move the appointment dynamically I get an error:



this is my code:




my question is, what do I have to do to be able to move an appointment that is called from a service and this is updated?



7 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team July 9, 2019 10:03 AM UTC

Hi Alejandro 
 
Syncfusion greetings. 
 
In your code example, crudUrl is not used which is the cause  for CRUD actions not working in Scheduler. We suspect that your requirement is to perform CRUD operation with updating data base and prepared the below sample for your reference. 
 
Note:  
  1.  To display the added event in UI (without updating data base) dataSource should have local data collection / empty array [].
  1. To display the added event in UI (with updating data base) dataSource should have correct crudUrl with service project in running state.
 
In dragStart event function, getCellDetails method is called with event element which is the cause for the script error and using addEvent method in that event is not correct scenario. Please revert with your case to proceed further. 
 
Regards, 
Karthi 



AG alejandro gil July 15, 2019 10:19 PM UTC

Hello Syncfusion

first I wanted to thank you for giving the correct response to the error that it presented, it served me a lot and I was able to correct the fault I had


Now I am trying to create a planner that shows the members of the group, I am taking as reference this:


But I do not understand why the staff does not want to show me, they can help me with this.

This is my code:









KK Karthigeyan Krishnamurthi Syncfusion Team July 16, 2019 08:47 AM UTC

Hi Alejandro, 
 
We are happy to hear that our solution worked for you. 
 
We suspect that your requirement is to display the block range in Scheduler and prepared the below sample for the same. 
 
To display block range, we need to set IsBlock field to true in event collection (even in data base) like below. 
 
{ 
      Id: 1, 
      Subject: 'Not Available', 
      StartTime: new Date(2018, 7, 1, 10, 0), 
      EndTime: new Date(2018, 7, 1, 12, 0), 
      IsAllDay: false, 
      IsBlock: true, 
      EmployeeId: 1 
    } 
 
If we have misunderstood your requirement or else if the above sample doesn’t satisfy your requirement, kindly share the following information with us to proceed further. 
  1. Code example/sample (if possible).  
  2. Image or vide demo explaining your requirement.  
 
Regards, 
Karthi 



AG alejandro gil July 17, 2019 08:01 PM UTC


Hello syncfusion

Again thanking for the solution of the problem and again with more concerns that I hope will not bother you hahaha.


I have to select the people I want to show in the scheduler with their respective appointment assigned to me. For this I have created the following object:






Once I select the people I want to show in the calendar, I click on the apply button and I must show the people that I select in the programmer with their respective appointment. To do it, I did it in the following way:

Html:



Ts:



Result:


As the selected people can see the sample, my questions is what do I have to do to show the people selected in the calendar once I click on the apply button, how do I assign it in the method ApplyFilterUsers () does not show me anything.

Thank you very much for your attention.






KK Karthigeyan Krishnamurthi Syncfusion Team July 18, 2019 11:06 AM UTC

Hi Alejandro, 
 
We are happy that our solutions are fulfilling your requirements. 
 
We have prepared the below sample for your requirement, kindly try it. 
 
onClick(): void { 
    var items = document.getElementsByName('calendar'); 
    var selectedItems = []; 
    for (var i = 1; i < items.length; i++) { 
      if ((items[i] as any).type == 'checkbox' && (items[i] as any).checked == true) 
        selectedItems.push((items[i] as any).value); 
    } this.scheduleObj.resourceCollection[0].dataSource = []; 
    for (var i = 0; i < selectedItems.length; i++) { 
      this.scheduleObj.addResource(this.calendarCollections[selectedItems[i] - 1], 'Calendars', (this.calendarCollections[selectedItems[i] - 1] as any).CalendarId); 
    } 
  } 
  onChange(args: ChangeEventArgs): void { 
    let value: number = parseInt((<Element>args.event.target).getAttribute('value'), 10); 
    let resourceData: Object[] = 
      this.calendarCollections.filter((calendar: { [key: string]: Object }) => calendar.CalendarId === value); 
    var a = document.querySelector('#resource'); 
    if (args.checked) { 
      a.innerHTML = a.innerHTML + ',' + JSON.stringify(resourceData[0]) 
    } 
    else { 
      a.innerHTML = a.innerHTML.replace(JSON.stringify(resourceData[0]), ''); 
    } 
 
  } 
 
Regards, 
Karthi 



AG alejandro gil July 22, 2019 08:28 PM UTC

hello syncfusion

thank you very much for the answer and I managed to solve the problem, but I have another question.

what type of validation should be developed so that if an appointment has the same schedule do not let put in that schedule ?


KK Karthigeyan Krishnamurthi Syncfusion Team July 24, 2019 06:09 AM UTC

Hi Alejandro,  
 
Thanks for the update. 
 
We can achieve your requirement using isSlotAvailable method and kindly refer the below links. 
 
Regards, 
Karthi 


Loader.
Live Chat Icon For mobile
Up arrow icon