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

Dynamically updating schedule resources


I'm using the EJ1 AngularJS Schedule component in an Angular 1.5.x project, specifically for the resources functionality. I've implemented the demo here

I can dynamically update the appointments data from the controller. However, I require the ability to do the same for the resources but the changes I apply to the dataSource aren't being reflected in the view. For example, the following isn't working:

          $scope.resourcedata.dataSource.push({ text: "Joe", id: 7, groupId: 1, color: "#51a0ed" });

I can apply changes if I do the folowing with jQuery:

          $("#MultipleResourceSchedule").data("ejSchedule").addResource({ text: "Joe", id: 7, groupId: 1, color: "#51a0ed" }, "Owners");

Is there something I'm missing or can the resources only be changed dynamically through jQuery?


2 Replies

KK Karthigeyan Krishnamurthi Syncfusion Team September 17, 2019 06:49 AM UTC

Hi Renato,  
Syncfusion greetings. 
To add resource, kindly use any one of the below ways. 
1. Two way binding is not supported, therefore data source should be reassigned and Scheduler should be manually refreshed. 
$scope.resourcedata.dataSource = [ 
                        { text: "Nancy", id: 1, groupId: 1, color: "#f8a398" }, 
                        { text: "Steven", id: 3, groupId: 2, color: "#56ca85" }, 
                        { text: "Michael", id: 5, groupId: 1, color: "#51a0ed" }, 
                        { text: "Joe", id: 7, groupId: 1, color: "#51a0ed" } 
2. Using public method (Recommended) 
$("#Schedule1").data("ejSchedule").addResource({ text: "Joe", id: 7, groupId: 1, color: "#51a0ed" }, "Owners"); 

RK Ravi Kumar March 31, 2020 07:22 AM UTC

If you are having an issues  how to update dynamic schedule resources in angular then i will suggest you to enhance your learning through angularjs online course where you will get to know the concepts of programming language in a better way.

Live Chat Icon For mobile
Up arrow icon