html5-scheduler-event-filtering.png

JavaScript

Since 7.9.1244 the Scheduler supports client-side event filtering.

See also:

Example

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

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

<script>

  var dp = new DayPilot.Scheduler("dp");
  // ...
  dp.onEventFilter = function(args) {

    // display only events that contain the specified text, case insensitive
    if (args.e.text().toUpperCase().indexOf(args.filter.toUpperCase()) === -1) {
      args.visible = false;
    }
  };
  dp.init();

  $(document).ready(function() {
      $("#filter").keyup(function() {
          var query = $(this).val();
          dp.events.filter(query); 
      });

      $("#clear").click(function() {
          $("#filter").val("");
          dp.events.filter(null);
          return false;
      });
  });
</script>

Demo:

Angular 2

Tutorial:

ASP.NET WebForms

Use ClientState to persist the filter parameters. 

You can store the filter settings in .clientState property on the client side:

dps.clientState.filterText = 'text';
dps.clientState.filterType = 'finished';

ClientState is persisted and updated with every callback (until you reload the page) and it's accessible on the server side.

string filterText = (string) DayPilotScheduler1.ClientState["filterText"];
string filterType = (string) DayPilotScheduler1.ClientState["filterType"];

DayPilotScheduler1.DataSource = LoadData(filterText, filterType);
DayPilotScheduler1.DataBind();
DayPilotScheduler1.Update();

ASP.NET MVC

Use ClientState to persist the filter parameters. 

You can store the filter settings in .clientState property on the client side:

dps.clientState.filterText = 'text';
dps.clientState.filterType = 'finished';

ClientState is persisted and updated with every callback (until you reload the page) and it's accessible on the server side.

string filterText = (string) ClientState["filterText"];
string filterType = (string) ClientState["filterType"];

Events = LoadEvents(filterText, filterType);
Update();