Filtering does not work if I get rid of sorters on TaskStore

Our Kanban Task Board for easy management of tasks and agile workflows
User avatar
pmiklashevich
Core Developer
Core Developer
Posts: 2372
Joined: Fri Apr 01, 2016 11:08 am

Re: Filtering does not work if I get rid of sorters on TaskStore

Post by pmiklashevich » Tue Nov 05, 2019 4:47 pm

The sorting by position is required for the TaskBoard to make Position field work right. You can also set this field according to the order you need. For example if you want "Fix IE11 bug" to be below "Install Chrome", "Fix IE11 bug" position should be greater. For example equal to 2.

Code: Select all

[
    { "Id" : 2, "Name" : "Install Chrome", "State" : "NotStarted", "NbrComments" : 1, "ResourceId" : 1, "Position" : 1},
    { "Id" : 1, "Name" : "Fix IE11 bug", "State" : "NotStarted", "ResourceId" : 1, "ImageUrl" : "resources/images/img.jpeg", "Position" : 2 },
I tried to use your MyKanbanTaskStore class but I got blank columns because Kanban.data.mixin.StoreView suspends data loading and expects sorting to trigger view refresh. If you want to customize this behaviour, you can override our classes, for example:

Code: Select all

Ext.define('TaskStoreOverride', {
    override : 'Kanban.data.TaskStore',
    constructor : function () {
        this.callSuper(arguments); // to jump over parent code which is not needed in your case
    }
});

Ext.define('StoreViewMixinOverride', {
    override : 'Kanban.data.mixin.StoreView',
    copyStoreContent : function () {
        var state = this.state;
        var data  = [];

        this.masterStore.each(function (rec) {
            if (rec.getState() === state) data[data.length] = rec;
        });

        this.loadData(data);
        // removed suspending events and sorting call
    }
});
P.S. I checked "highlight" and "filter" features in the toolbar. Both worked with the overrides.
Pavel Miklashevich - Core Developer

User avatar
rwankar
Premium Member
Premium Member
Posts: 201
Joined: Fri Apr 22, 2011 6:06 am

Re: Filtering does not work if I get rid of sorters on TaskStore

Post by rwankar » Thu Nov 07, 2019 5:53 am

Thanks. I'll give this a try.

Post Reply