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

Conditional display of Active Areas

Asked by Steve Lee
1 year ago.

Is it possible to conditionally display an active area? If a DB field is not NULL then display the active area. If the DB field is NULL then hide the active area? If this is possible could you show me a code example?

Thank you.

Answer posted by Dan Letecky [DayPilot]
1 year ago.

Yes, this is possible. You can add active areas using onBeforeEventRender where you can check if a specific property exists in the source data object (args.data):

onBeforeEventRender: args => {
  if (args.data.myField) {
    args.data.areas = [
      // ...
    ];
  }
}

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

Comment posted by Steve Lee
1 year ago.

Thank you very much Dan

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