search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Add custom rows

Asked by Aldo Bertoldini
9 years ago.

In my room planner I'd like to add a couple of rows not interactive, one displaying number of checkins and checkouts and another one displaying occupancy % and number of free rooms by room type. This rows should not interact with the rest of the room planner (events, drag and drop etc)

Is there a way to add such rows?

As an alternative, I added two resources to the scheduler, one for chkin/chkout and one for occupancy. Is there a way to merge row header cells and a way to disable dropping on a row?

Thanks

Answer posted by Dan Letecky [DayPilot]
9 years ago.

At this moment you can't fully disable the row - but you can implement custom rules that are evaluated in real time.

  • use onEventMoving for custom moving rules
  • use onTimeRangeSelecting for custom time range selecting rules (creating events)

Example from http://javascript.daypilot.org/demo/scheduler/:

    dp.onEventMoving = function(args) {
        // don't allow moving from A to B
        if (args.e.resource() === "A" && args.resource === "B") {
            args.left.enabled = false;
            args.right.enabled = true;
            args.right.html = "You can't move an event from resource A to B";

            args.allowed = false;
        }
    };

You can implement something similar in onTimeRangeSelecting, just checking the target row id (args.resource).

    dp.onTimeRangeSelecting = function(args) {
      if (args.resource === "A") {
            args.left.enabled = false;
            args.right.enabled = true;
            args.right.html = "You can't create an event here";

            args.allowed = false;
      }
    };
This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.