Our flexible Kanban board for managing tasks with drag drop


Post by pfund »

Hi,

we evaluate your taskboard and have some questions about the stores. we already have an existing store (with singlr intergration) and tried to connect it with your TaskStore class.

it looks like:

export class MyStore extends TaskStore {

    public projectId: Guid;

    constructor(private kanbanService: KanbanService, config?: Partial<TaskStoreConfig>) {
        super(config);
    }

    public async load(): Promise<any>{
        const data = this.kanbanService.getTasks()
        this.data = data;
        console.log('mystore', data, this.data);
        return Promise.resolve(data);
    }

    public insert(a,b): TaskModel[] {
        console.log('mystore insert', a,b);
        return [];
    }

    public add(a,b): TaskModel[] {
        console.log('mystore add', a,b);
        return [];
    }


    public async commit(): Promise<any> {
        console.log('mystore commit');
    }
}

Our questions:

  • is there an easier way to combine an already existing store with your taskboard ?
  • is overriding the functions in TaskStore the best way to implement an external store

another solution was to assign the project.tasksData (https://www.bryntum.com/docs/taskboard/#TaskBoard/model/ProjectModel#config-tasksData)
and config.columns with our existing store (the store already returns columns and tasks as arrays)
but here rises another question:

  • how do we manage things like updates or inserts ? our stores needs us to call update,insert,delete methods
  • can we use the taskboard without a store ?

best regards,

Marinus


Post by johan.isaksson »

Hi,

Starting with the last question, TaskBoard cannot be used without its stores.

Regarding the best approach to integrate with your existing SignalR store, I would probably create an intermediate "layer" keeping them in sync. It would subscribe to the relevant events on TaskBoards stores and update the SignalR store as appropriate (and vice versa).

taskBoard.project.taskStore.on({
  change({ action, records, ... }) {
     switch (action) {
       case 'add':
          singlaRStore.add(records.map(r => r.json));
          break;
        ....
     }
  }
});

Extending the TaskStore as you show above also sounds like a good approach to me. The amount of work required is likely similar between the two, the same changes needs to be intercepted somehow no matter which approach is choosen.

As an alternative you could perhaps try the syncDataOnLoad config that exists on our stores. Its purpose is to figure out the diff between a new dataset and its current dataset and only apply the changes. Might make it easier to keep the TaskBoard side of things up to date, when data changes in your SignalR store you could plug the entire dataset into the TaskStore and it would add, remove and modify according to what changed.

Hope this helps, good luck!

Best regards,
Johan Isaksson

Post by pfund »

hi,

thanks for your fast reply, that helped a lot.


Post Reply