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

Remove Gesture of Calendar

1 Answer 165 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
saw aung
Top achievements
Rank 1
saw aung asked on 08 Feb 2018, 08:44 AM

Hi

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;

this.myCalendar.off(GestureTypes.swipe);
this.myCalendar.off(GestureTypes.doubleTap);

 

1 Answer, 1 is accepted

Sort by
0
Nick Iliev
Telerik team
answered on 08 Feb 2018, 12:07 PM
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 


Regards,
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.
Tags
Calendar
Asked by
saw aung
Top achievements
Rank 1
Answers by
Nick Iliev
Telerik team
Share this question
or