Hi all,
I have 2 resource types in my scheduler that need to be multi-select: Student Group & Room. I've implemented Student Group as per the MultipleValuesResourceControl from the demo using a DBProvider & all is working fine.
However, I'm attempting to show Rooms as a RadGrid because I need to show room number, description, capacity & room type, which is rather too long to concatenate into a list item. The RadGrid is showing the rooms correctly & on sample appointments where I've pre-populated the rooms in the database they are being ticked/selected correctly - although I had to move that into ItemDataBound.
When stepping through the code I can see that the data key values are being pulled from the grid into the array & into ResRoom.Value; however the resource doesn't get attached to the appointment. When the SchedulerDBProvider is reached for insert or update only student groups are in the resource list.
Is this due to the javascript? I saw that AdvancedForm.js only handles multi-valued resources as checkboxes & modified as below, but still have the issue.
01.
this
._scheduler.get_resourceTypes().forEach(
function
(resourceType) {
02.
var
resourceTypeName = resourceType.get_name();
03.
var
baseName = template._templateId +
"_Res"
+ resourceTypeName + resourceControlSuffix;
04.
var
resourcesOfThisType = schedulerResources.getResourcesByType(resourceTypeName);
05.
06.
if
(resourceType.get_allowMultipleValues()) {
07.
if
(resourceTypeName =
"Room"
) {
08.
var
masterTable = $find(baseName).get_MasterTableView();
09.
var
items = masterTable.get_dataItems();
10.
if
(items.length > 0)
11.
apt.get_resources().removeResourcesByType(resourceTypeName);
12.
13.
for
(
var
i = 0; i < count.length; i++) {
14.
if
(items[i].selected && resourcesOfThisType.get_count() >= i) {
15.
apt.get_resources().add(resourcesOfThisType.getResource(i));
16.
}
17.
};
18.
}
19.
else
{
20.
var
checkBoxes = $(String.format(
"input[id*='{0}']"
, baseName),
this
._formElement);
21.
22.
if
(checkBoxes.length > 0)
23.
apt.get_resources().removeResourcesByType(resourceTypeName);
24.
25.
for
(
var
i = 0; i < checkBoxes.length; i++) {
26.
if
(checkBoxes[i].checked && resourcesOfThisType.get_count() >= i)
27.
apt.get_resources().add(resourcesOfThisType.getResource(i));
28.
};
29.
}
30.
}
I'm using SchedulerDBProvider rather than a WebService
thanks,
Ellie