Remove Gesture of Calendar

Thread is closed for posting
2 posts, 0 answers
  1. saw aung
    saw aung avatar
    1 posts
    Member since:
    Sep 2017

    Posted 08 Feb 2018 Link to this post


    Calendar is displayed in month view, and I don't want user to double tap and swipe calendar, I only want to show month view, double tapping changes calendar view to year view, I try to off those events but not working.

    this.myCalendar.viewMode = Calendar.CalendarViewMode.Month;;;


  2. Nikolay Iliev
    Nikolay Iliev avatar
    351 posts

    Posted 08 Feb 2018 Link to this post

    Hello Saw Aung,

    You can disable the transition from Month to Year (when double tapping) by using the native methods inherited from RadCalendarView that extends the RadCalendar.
    The RadCalendarView has its own GestureMangaer which has method suitable for the wanted functionality (this one).

    Here is an example to disable the double tap viewMode transition on Android.

    In the HTML file (Angular example)
    <RadCalendar (loaded)="onCalendarLoaded($event)" ></RadCalendar>

    And the implementation of onCalendarLoaded callback
    onCalendarLoaded(args) {
        let calendar = <RadCalendar>args.object;
        let telCalendar = calendar.nativeView; // com.telerik.widget.calendar.RadCalendarView
        let gestureManager = telCalendar.getGestureManager(); // com.telerik.widget.calendar.CalendarGestureManager
        gestureManager.setDoubleTapToChangeDisplayMode(false); // true is the default value

    With the above code, the calendar on Android will always remain in Month mode. A similar approach can be applied to iOS as well.

    Keep in mind that we recommend using the community channels for questions related to nativescript-pro-ui plugin such as the dedicated repository
    for logging issues related to the very same plugin 

    Nikolay Iliev
    Progress Telerik
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
Back to Top