I am utilizing the scheduler via MVVM in my application. The application is set up so that on databound, a left column displays all users that have events in the scheduler. For each user listed in the column, there is a kendo color picker. The right hand side has the scheduler.
I would like to have the users in the left column chose a color from the picker and set it so that all of the events that they own in the scheduler (on the rightside) will utilize the chosen color.
I am a little confused on the best way to go about this. Please advise.
6 Answers, 1 is accepted
Updating the resources colors depends on how you load them - for example if they are static data on the client side you can use the following approach to update them:
If the resources are loaded using remote binding than you can simply call the "read" method of the corresponding resource.
Unfortunately this does not quite seem to tackle what i need to accomplish. I have a list of users being loaded dynamically outside of the scheduler via json file. When a person is selected I need to display their events in the scheduler. Additionally, each person has a colorpicker associated with their record. I need the colorpicker to dynamically change the color of the events associated with the person within the scheduler. Very much like using google calendar.
Actually the example that I provided shows how to edit the resources (users) properties using the dataSource and it's model API. Yon can further customize the example to do this using separate controls outside the Scheduler (custom solution). Another option is to include the ability of editing these resources directly in the editor template of the Scheduler as demonstrated in the following demo:
I see what you mean. However, I noticed that you bound the resources using the data-resources attribute. Is there a way to use the data-resources attribute to point to a property in my view model containing an object composing of what would be the resources? I would assume once those items are in my view model I can pass data into them to update the event color.
Please check the answers of your questions below:
1) Is there a way to use the data-resources attribute to point to a property in my view model containing an object composing of what would be the resources - There is no build-in resource binding, however you can implement one using custom binding.
2) Also, I noticed a lot of examples i'm seeing are using static data for the resources. Is there a way to make it more dynamic? - Loading the resources from remote service is already shown in the example linked in my previous reply.