Hide empty Rooms ( Resources ) from the Scheduler header

Hi,

How to programatically hide empty ResourceDirective from the header.

For example. I have 6 defined rooms as ResourceDirective, how to hide empty rooms from the header and scheduler.

Is there some built solution like showHeaderWhenEmpty for a table or not ?

Please check this image to better understand my logic here.

Screenshot 2025-08-13 at 1.37.00 pm.jpg


Thanks,

Sinisa


7 Replies

SS Saritha Sankar Syncfusion Team August 13, 2025 06:43 AM UTC

Hi Sinisa,


In the current implementation of the Scheduler component, the functionality to hide empty resources is not supported.

Specifically, it is not possible to hide a resource directive when there are no events associated with it within grouped resources.


Regards,

Saritha S.



SI Sinisa August 13, 2025 08:00 AM UTC

Thanks you very much.

Cheers,

Sinisa



SS Saritha Sankar Syncfusion Team August 14, 2025 06:31 AM UTC

Hi Sinisa,

You're welcome. Please get back to us if you need any further assistance. 

Regards,
Saritha S.



SI Sinisa August 14, 2025 07:51 AM UTC

One more question.

Can you suggest to me how to determinate that this view is displayed or is clicked on this navigation button ?

I can only find viewIndex inside of onNavigation method. But I was thinking about passing some custom props or some other unique  id that is not made programatically like ID is.

I will appreciate any help with this I have specific needs to display different data which depend on current view ( for day / week view only data for current login user, but when is room view included the data for other user who have booked events in those rooms) . 

Thanks in advance. 

this is my code  to call this ViewDirective connected with roomm

{roomData && roomData.length && (
<ViewDirective
option="Day"
displayName="By Room"
orientation="Horizontal"
allowMultiple={true}
group={{ resources: ["Rooms"] }}
/>
)}
{roomData && roomData.length && (
<ViewDirective
option="Week"
displayName="Week By Room"
orientation="Horizontal"
allowMultiple={true}
group={{ resources: ["Rooms"] }}
/>
)}


SR Swathi Ravi Syncfusion Team August 15, 2025 08:02 AM UTC

Hi Sinisa,

You can identify which view was clicked during the navigation event using the following snippet:

 const schedulerRef = useRef(null);

 function onNavigating(args) {
        let views = schedulerRef.current.views.filter(x => x.option == args.currentView);
        let seletcedView = views[0].displayName;
        console.log(seletcedView);
 }

 <ScheduleComponent ref={schedulerRef}  navigating={onNavigating}>




Let me know if you need further clarification or assistance!

Regards,
Swathi Ravi


SI Sinisa August 15, 2025 08:21 AM UTC

Thanks you, that is perfect ! 


Cheers,

Sinisa



VR Vijay Ravi Syncfusion Team August 18, 2025 04:19 AM UTC

Hi Sinisa,

 

Thanks for your update. We are glad to know that your issue has been resolved. Please get back to us if you need any other assistance.

 

Regards,

Vijay


Loader.
Up arrow icon