DayPilot.Scheduler.rows.filter

Filters Scheduler rows using the specified parameter.

Declaration

DayPilot.Scheduler.rows.filter(params)

Arguments

  • params - custom object (or a simple string value) that will be passed to onRowFilter event as an argument

Example

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

<div id="dp"></div>

<script>
  $(document).ready(function() {
      $("#filter").keyup(function() {
          var query = $(this).val();
          dp.rows.filter(query); // see dp.onRowFilter below
      });

      $("#clear").click(function() {
          $("#filter").val("");
          dp.rows.filter(null);
          return false;
      });
  });

  var dp = new DayPilot.Scheduler("dp");
  dp.onRowFilter = function(args) {
      if (args.row.name.toUpperCase().indexOf(args.filter.toUpperCase()) === -1) {
          args.visible = false;
      }
  };

  // ...

  dp.init();

</script>