Our Kanban Task Board for easy management of tasks and agile workflows


Post by b.wust »

Hi, i have a Question About the Taskboard.

When i select a Special User as Resource i want to remove the Element from the Taskboard.
For Example when i select Brian in your Advanced Example i want to remove it.

how can i do that ?
taskboard.png
taskboard.png (225.18 KiB) Viewed 4912 times

Post by pmiklashevich »

Hello,

Please see API: https://www.bryntum.com/docs/taskboard-for-extjs/#!/api/Kanban.view.TaskView-method-taskRenderer
Ext.define('Kanban.examples.advanced.view.KanbanPanel', {
    viewConfig : {
        taskRenderer : function (task, renderData) {
            // better to compare to ID of the resource
            if (task.getResource() && task.getResource().getName() === 'Brian') {
                renderData.ImageUrl = null;
            }
        }
    },
Best,
Pavel

Pavlo Miklashevych
Sr. Frontend Developer


Post by b.wust »

Thx for the fast Reply, but this is only Setting the Image to null. I want to completly remove the Entry where i select for example Brian from the Taskboard that it is not shown anymore.

Post by pmiklashevich »

What do you mean by "Element"? I got it as Image element. Do you mean task element? There are 2 options to "remove" task element:

1. Remove the task from the store
        taskBoard.taskStore.on('update', function(store, record) {
            if (record.getResource() && record.getResource().getName() === 'Brian') {
                store.remove(record);
            }
        });
https://docs.sencha.com/extjs/7.0.0/classic/Ext.data.Store.html#method-remove

2. Filter out task from the store
        taskBoard.taskStore.filterBy(function(record) {
            return !record.getResource() || record.getResource().getName() !== 'Brian';
        });
https://docs.sencha.com/extjs/7.0.0/classic/Ext.data.Store.html#method-filterBy

Pavlo Miklashevych
Sr. Frontend Developer


Post by b.wust »

Thanks pmiklashevich, that is exactly what i was searching for.
I Need to remove the task from the store completly if a Special resource is selected.

Post Reply