When the user toggles a checkbox on my screen, I am finding certain event DIV elements, then toggling them with .hide() and .show(). The jQuery .hide will set the CSS display to 'none', which is all good, but because the event elements all use absolute positioning (top/left), the hidden events still appear to take up space to the user. I can't find anything built in that would help to readjust the visible appointments in the scheduler. I'd hate to have to try to write code to reposition events in any cell that was affected, but I may not have a choice. Anyone have any other ideas for this? It would be nice if the SchedulerEvent object actually had a Visible property, and when set, the scheduler's view would readjust things accordingly. I can't be the first to ask for this one...
5 Answers, 1 is accepted
In such scenarios we recommend hiding the events as it is done in this online demo by filtering the dataSource. This way the events are not taking space after hiding.
Regards,
Plamen
Telerik
We have .ServerOperation(true) set on the scheduler MVC helper, so on any view change, it goes back to the server. With that option turned off, the .filter method worked great...appointment blocks were hiding/showing as expected. With the option on though, the filter method causes it to go fetch the appointments again from the server (which I guess makes sense). We initially load up all the appointments, so I really just want to be able to take certain ones out after the load, and only client-side. If the filter method will not work in our case, can you recommend any other way? Thanks!
this._pdScheduler._scheduler.dataSource.options.serverFiltering = false;
if (displayClientOnly) {
this._pdScheduler._scheduler.dataSource.filter({
operator: function (apptEvent) {
return apptEvent.ProspectKey == prospectKey;
}
});
} else {
this._pdScheduler._scheduler.dataSource.filter({});
}
Yes, in this scenario the .ServerOperation(true) is still valid and unfortunately there is no way to prevent it for the custom filtering you are trying to achieve. The filtering can be either server of client side.
Regards,
Plamen
Telerik