Hello
I have a scheduler that I'm grouping on a resource; rooms. When I filter the scheduler on rooms, I want to hide the groups of rooms that are not selected in the filter.
I have looked at this example, but I don't get it to work. The filering part works as intended, but not the hiding of the filtered rooms. I will post, what I think is all relevant parts of my code. If you need more info please ask me to provide it. (IE Alex, Bob and Charlie from the link are the corresponding entities to my rooms)
First, the grouping and resource binding part of the scheduler:
.Group(group => { group.Resources("Room"); })
.Resources(resource => resource.Add(m => m.roomId)
.Title("Room")
.Name("Room")
.DataTextField("name")
.DataValueField("id")
.DataColorField("Color")
.DataSource(ds => ds.Read("GetRooms", "Home")))
Then the function for viewing only selected rooms:
function
viewRoom() {
var
checked = $.map($(
"#factories :checked"
),
function
(dropdown) {
return
parseInt($(dropdown).val());
});
var
filter = {
logic:
"or"
,
filters: $.map(checked,
function
(value) {
return
{
operator:
"eq"
,
field:
"roomId"
,
value: value
};
})
};
var
scheduler = $(
"#scheduler"
).data(
"kendoScheduler"
);
scheduler.dataSource.filter(filter);
scheduler.view(scheduler.view().name);
}
From what I understand this row should update the view with only the selected rooms visibible in the scheduler, but it doesn't:
scheduler.view(scheduler.view().name);
Can anyone see what I'm doing wrong?
BR
Jonas