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

How to add text field in cell?

Asked by Fábio
7 years ago.

This question already answered with non-recommended pratice, because cell redraw.

Can we add a text to a resource cell group on schedular with tree view? Example,

Group 1 has 3 children with availability by day, on cell of group (by day), i want indicate how many children is available.

Attachment example.

Thanks.

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

Yes, you can add custom HTML to grid cells using onBeforeCellRender event handler.

Example:
dp.onBeforeCellRender = function(args) {
  if (args.cell.resource === "A")
    args.cell.html = "12";
  }
};

See also:
https://doc.daypilot.org/scheduler/cell-customization/

This event is fired whenever the grid is redrawn (during initialization, during updates, during scrolling).

It's also possible to set the cell HTML on the fly without redrawing the Scheduler:

dp.rows.find("A").cells.all().html("12");

See also:
https://api.daypilot.org/daypilot-scheduler-rows-find/
https://api.daypilot.org/daypilot-row-cells-all/

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.