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

Dynamically updating schedule resources

Thread ID:

Created:

Updated:

Platform:

Replies:

147558 Sep 16,2019 12:28 PM UTC Mar 31,2020 07:22 AM UTC AngularJS 2
loading
Tags: ejSchedule
Renato
Asked On September 16, 2019 12:28 PM UTC

Hi,

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?

Thanks 

Karthigeyan Krishnamurthi [Syncfusion]
Replied On 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" } 
                    ]; 
                   $("#Schedule1").data("ejSchedule").refresh(); 
 
2. Using public method (Recommended) 
 
$("#Schedule1").data("ejSchedule").addResource({ text: "Joe", id: 7, groupId: 1, color: "#51a0ed" }, "Owners"); 
 
Regards, 
Karthi 


Ravi Kumar
Replied On 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.

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