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

Column Filtering

Asked by Sven Heuer
11 months ago.

Hi, is there a way to filter "empty" columns like it is possible for the schedular.

I am looking for something like this:

onColumnFilter (args) {
  var roomIsOccupied = (!args.events.isEmpty());
  args.visible =  roomIsOccupied);
}

Currently I have a "checkbox room list" and I can enable/disable a room. But if I filter a calendar, i want only see these rooms, which a "accouppied" by the filter.

Answer posted by Dan Letecky [DayPilot]
11 months ago.

In the latest sandbox build (2023.2.5562 - see https://release.daypilot.org/changes/js/), the args.column property now holds a DayPilot.Column object (https://api.daypilot.org/daypilot-column-class/) which you can use to find the related events and also check if the column is empty:

onColumnFilter (args) {
  var roomIsOccupied = !args.column.events.isEmpty();
  args.visible = roomIsOccupied);
}
Comment posted by Sven Heuer
11 months ago.

Thank you very, very much!!!!

Best regards
Sven

Comment posted by Sven Heuer
11 months ago.

Hi Dan,

I tried its but got a "Uncaught TypeError: e.events is undefined"

onColumnFilter (args) {
  var roomIsOccupied = !args.column.events.isEmpty();
  args.visible =  roomIsOccupied;
}

Missed I something obviously?

Sven

Comment posted by Dan Letecky [DayPilot]
11 months ago.

Hi Sven,

There was a problem with the implementation - but it should be fixed now in the latest sandbox build (2023.2.5566). Please let me know if the problem persists.

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