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

Dynamically hidden event still takes up space

5 Answers 138 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 16 Sep 2015, 03:25 PM

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

Sort by
0
Accepted
Plamen
Telerik team
answered on 18 Sep 2015, 07:38 AM
Hi,

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
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Michael
Top achievements
Rank 1
answered on 18 Sep 2015, 07:42 PM

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!

 

0
Michael
Top achievements
Rank 1
answered on 18 Sep 2015, 07:45 PM
Sorry, just to clarify, we initially load up all the appointments for the current view and date range, from the server.  At that point, with the week the user is viewing, they can click a checkbox to only view certain ones.  It is that operation that we want only client-side.  I'm starting to think we may just have to go fetch the week's appointments from the server again when they use the checkbox, and the server just knows to not return those appointments we want to "hide".  It doesn't sound like the most efficient way, but should work.  Let me know if you have any other suggestions though.
0
Michael
Top achievements
Rank 1
answered on 18 Sep 2015, 08:01 PM
If I set serverFiltering to false on the datasource, it does apply my filter client-side... unfortunately, it also still goes back to the server to fetch all the same appointments again, THEN applies the client-side filter.  I was expecting that setting to cause it to only apply filtering client-side, and not read on the datasource again.

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({});
}
0
Plamen
Telerik team
answered on 22 Sep 2015, 01:46 PM
Hi,

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
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Scheduler
Asked by
Michael
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Michael
Top achievements
Rank 1
Share this question
or