2 min read

Filtering Resources And Tasks In Ext Scheduler

Filtering
Filtering is a critical feature in any data table or scheduler component where you want to work with large data […]

We strive to keep posts updated, but code samples may sometimes be outdated. Humans, see the Bryntum documentation; agents, https://mcp.bryntum.com for the latest info.

Filtering is a critical feature in any data table or scheduler component where you want to work with large data sets efficiently. In our Scheduler component you would typically want to filter resources or their tasks but you can even filter the TimeAxis. To show how easy it is to filter your ResourceStore or EventStore, we built a small sample:

Screen Shot 2018-02-12 at 23.24.16

In this sample you can try resource filtering as well as both filtering and highlighting tasks. The magic is done purely by the powerful Ext JS Store class which offers a filter method that is used in the demo. You can filter by any field/value in your model, or use the filterBy method to provide a filterer function. The filter fields you see in the demo are simple Ext JS TextFields which are fed the target store as a config property:

Ext.define('Sch.examples.filtering.view.FilterField', {
    extend : 'Ext.form.TextField',
    xtype  : 'demofilterfield',

    enableKeyEvents : true,
    store    : null,
    property : '',

    initComponent : function () {
        this.store = Ext.StoreMgr.lookup(this.store);
        this.callParent(arguments);
    },

    onKeyUp : function (e) {
        var value = this.getValue().toLowerCase();
        var store = this.store;

        if (e.getKey() === e.ESC) {
            store.clearFilter();
            this.setValue('');
        } else {
            store.filter([
                {
                    property : this.property,
                    value    : value,
                    anyMatch : true
                }
            ]);
        }
    },

    listeners : {
        keyup : 'onKeyUp'
    }
});

We hope you download our latest version to try out the filtering demo, and please let me know if you’d like to any other feature showcased in our demos. Happy filtering!

Mats Bryntse

Mats Bryntse is the founder and CEO of Bryntum, where he leads the team building advanced scheduling and project planning components for the web. He has spent the past 15 years focused on component performance, developer experience, and making complex user interfaces feel simple. Bryntum's components cover Gantt charts, data grids, calendars, schedulers, and Kanban boards, and Mats works across all of them, from API design to the details of rendering large data sets in the browser. Away from work he plays chess and badminton.

Ext Scheduler

Try Bryntum components

Fast, framework-agnostic UI components for scheduling and project management.

Start a free trial

Related posts