Timeline date k-nav-day not working

4 posts, 0 answers
  1. SLM
    SLM avatar
    15 posts
    Member since:
    Oct 2011

    Posted 24 Apr 2017 Link to this post

    Hello,

    The k-nav-day directive is not working in "timelineMonth" view.

    Dojo : http://dojo.telerik.com/IyEmA

    Expected : A click on a date in the "timelinemonth" view should change the view to "dayview."

    Actual : A click on a date in the "timelinemonth" do nothing.

     

    Thank you,

    SLM

  2. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1208 posts

    Posted 25 Apr 2017 Link to this post

    Hi,

    The click on the ​.k-nav-day link in the day header of the TimelineMonth view is designed to navigate to the Timeline view for the respective day. You could observe that default behaviour of the widget on the Scheduler Timeline demo.

    When there is no Timeline view configured (as on the Dojo sent), no navigation is expected to occur.


    Regards,
    Veselin Tsvetanov
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. SLM
    SLM avatar
    15 posts
    Member since:
    Oct 2011

    Posted 26 Apr 2017 in reply to Veselin Tsvetanov Link to this post

    Hello,

    I understand that it's not a bug,

    But, is it possible to do it anyway ?

    Thank you,

    SLM

  4. Veselin Tsvetanov
    Admin
    Veselin Tsvetanov avatar
    1208 posts

    Posted 28 Apr 2017 Link to this post

    Hi,

    Yes, the required could be achieved by applying some custom logic to the click event handler on the k-nav-day link and to the navigate event handler of the Scheduler:
    var selectedDate;
    var shouldPreventNavigation;
    $("#scheduler").kendoScheduler({
        navigate: function(e) {
          console.log('nav');
          var view = e.view;
          selectedDate = e.date;
           
          if (shouldPreventNavigation) {
            shouldPreventNavigation = false;
            e.preventDefault();
          }
        },
    ...........
     
    $('.k-nav-day').on('click', function(){
      console.log('click');
      shouldPreventNavigation = true;
      var scheduler = $("#scheduler").data('kendoScheduler');
       
      setTimeout(function(){
         console.log('change');
         scheduler.view('day');
         scheduler.date(selectedDate);
      }, 0);
    });

    Here you will find a small Dojo sample, implementing the above.

    Regards,
    Veselin Tsvetanov
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top