jQuery UI Widgets Forums Scheduler Does anyone have recommendations for: Scheduler?

This topic contains 1 reply, has 2 voices, and was last updated by  admin 3 months, 4 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • vitorio
    Participant

    How do I switch jqxScheduler to timeline view using jQuery after it’s already initialized? I want to toggle views with buttons.


    admin
    Keymaster

    Hi,

    You can use the “view” property to switch the views in jqxScheduler.

    <div id="scheduler"></div>
    
    <button id="dayBtn">Day</button>
    <button id="timelineBtn">Timeline</button>
    
    <script>
      $(document).ready(function () {
        // initialize scheduler
        $("#scheduler").jqxScheduler({
          date: new $.jqx.date(2025, 8, 19),
          width: 850,
          height: 600,
          source: new $.jqx.dataAdapter({ localData: [], dataType: "array" }),
          showLegend: true,
          view: 'dayView',
          views: ['dayView', 'weekView', 'monthView', 'timelineDayView', 'timelineWeekView']
        });
    
        // switch to normal day view
        $("#dayBtn").on("click", function () {
          $("#scheduler").jqxScheduler("view", "dayView");
        });
    
        // switch to timeline view
        $("#timelineBtn").on("click", function () {
          $("#scheduler").jqxScheduler("view", "timelineDayView");
        });
      });
    </script>

    Best regards,
    Peter Stoev

    jQWidgets Team
    https://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.