DayPilot.Scheduler.rows.filter

The rows.filter() method applies a row filter to the JavaScript Scheduler component rows.

Declaration

DayPilot.Scheduler.rows.filter(params)

Parameters

  • params - custom object or simple string value that will be passed to the onRowFilter event as args.filterParam.

Notes

To clear the filter, use a null value or call rows.update() without arguments.

Example

<div class="space">
Filter: <input id="filter" /> <a href="#" id="clear">Clear</a>
</div>
<div id="dp"></div>

<script>
const dp = new DayPilot.Scheduler("dp", {
  onRowFilter: (args) => {
    if (args.row.name.toUpperCase().indexOf(args.filter.toUpperCase()) === -1) {
      args.visible = false;
    }
  },
  // ...
});
dp.init();

const filter = document.getElementById("filter");
const clear = document.getElementById("clear");

filter.addEventListener("keyup", () => {
  dp.rows.filter(filter.value); // see onRowFilter handler above
});

clear.addEventListener("click", (event) => {
  event.preventDefault();
  filter.value = "";
  dp.rows.filter(null);
});
</script>

See Also

DayPilot.Scheduler.onRowFilter

Row Filtering [doc.daypilot.org]

DayPilot.Scheduler Class

Availability

Availability of this API item in DayPilot editions:

LitePro
DayPilot for JavaScript