Disable week navigation

Hi, 

I have found info about disabling view navigation but I might not be understanding exactly what it means because I can still navigate when I disable it. Even in this example:https://flutter.syncfusion.com/#/event-calendar/getting-started when view navigation is disabled, one can move to next week using ctrl+arrows or by simply using arrows to move through days and eventually to next week. I have tried viewNavigationMode:ViewNavigationMode.none on my code and I get the same behaviour. I want the widget to show the current week only, and not allow the user to move to the next week at all, is not that possible?


Thanks!


1 Reply

IR Indumathi Ravichandran Syncfusion Team June 7, 2023 01:38 PM UTC

Hi Raquel,


As per the current implementation, allowViewNavigation property used to  navigate to the day view by tapping on the month cell and view header of the calendar views and viewNavigationMode property is used to restrict
the previous or next views
navigation through interaction. There is no direct support to disable the view navigation using keyboard interaction, but you can achieve this requirement by handling the minDate and maxDate as per your requirement dynamically.


Example Code snippet:


child: SfCalendar(

 view: CalendarView.workWeek,

viewNavigationMode: ViewNavigationMode.none,

showNavigationArrow: true,

minDate: DateTime(2023, 6, 5, 9, 0, 0),

maxDate: DateTime(2023, 6, 9, 9, 0, 0),

),


Also please find the UG documentation for min and max dates.

https://help.syncfusion.com/flutter/calendar/date-navigations#minimum-display-date

https://help.syncfusion.com/flutter/calendar/date-navigations#maximum-display-date


Please find the KB documentation for restricting the visible date range.


https://support.syncfusion.com/kb/article/10740/how-to-restrict-the-visible-date-ranges-in-the-flutter-calendar


we hope that this helps you. Please let us know if you need further assistance.


Regards,

Indumathi R


Loader.
Up arrow icon