This is a migrated thread and some comments may be shown as answers.

Filtering Resources and Update Failures

1 Answer 59 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Alex
Top achievements
Rank 1
Alex asked on 05 Apr 2011, 12:35 AM
OK, Here's is my situation.

I have an application that is used to manage training events in different cities around the country.
I have a page that has a radPanel on the left side of the page and a RadScheduler on the right.
The RadPanel contains 8 checkboxes, each representing a city. When the user selects a checkbox, a postback is performed and if there are appointments scheduled for the selected city, they are displayed in the RadScheduler.  

Each city has a number of instructors assigned to it. The instructors are setup as resources in a custom provider that Ive written. In order to pass the Selected_Training_City_ID as a parameter to the custom provider, Ive setup the custom provider to be instantiated on each page load. I filter the instructor resources based on the Selected_Training_City_ID so that only instructors from the selected city are shown on the Advanced Edit Form.

This all works great....Now here's the problem. Each time a new city is selected, the page does a postback and reloads the Instructor resources based on which city checkbox is selected. Then, when a change is made to an appointment, but that isnt the currently selected city, the resource is not available and the update fails.

For example, let say I do the following:

1. select New york from the city checkboxs
2. the page posts back and loads the instructors (Joe and Jim) for NY as Instructor resources into the provider.
3. I double click the scheduler and create an appointment, I select Joe and Jim as the instructors, fill out the other details and save it.
4. back on the main page, I now check the Chicago checkbox and un-check NY.
5. the page posts back and loads the instructors (Mary and Jane) for Chicago as resources into the provider.
6. Now I click and hold my NY appointment and move it, the Instructor resources (Joe and Jim from NY) aren't available since Chicago is currently checked and my update fails.

Is there a recommended approach for handling a use case like this?
Any help would be greatly appreciated.
Thanks in advance.
Alex

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 07 Apr 2011, 01:39 PM
Hi Alex,

I recommend you expose the city as a separate resource type. This way when you select a city from the panelbar, only appointments for this resource would show up. Here is a demo for reference -
http://demos.telerik.com/aspnet-ajax/scheduler/examples/resources/defaultcs.aspx

I suppose you have seen the help topic on Sending additional information to the provider, but here it is just in case.


Best wishes,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Scheduler
Asked by
Alex
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or