Our state of the art Gantt chart


Post by casman.manzano »

Hi, How would I access the current taskstore for the gantt being currently viewed in Angular?

ideally I would like to add something to it but can't seem to find the object when calling from Angular. Ideally I would like to do something like this:

taskStore.add({ pk : 10, name : 'foo' })
task = taskStore.getById(10);
task.id // 10

i've imported gantt from bryntum lib:

import {
  Gantt,
  TaskStore,
  Scheduler,
  CrudManager,
  ProjectModel,
  Store,
} from "@bryntum/gantt/gantt.lite.umd.js";


  public gantt: Gantt;

and have Gantt tied to a variable which is being #gantt on the bryntum component.

But where would I be able to access taskStore? thx


Post by casman.manzano »

also my project looks like this:

 const project = {
      // Let the Project know we want to use our own Task model with custom fields / methods
      taskModelClass: LoupeModel,
      autoLoad: false,
      autoSync: true,
      startDate: "2020-01-14",
      transport: {
        load: {
          url: `${this.url}entity/gantt_load/`,
          headers: this.headers,
        },
        sync: {
          url: `${this.url}entity/gantt_sync/`,
          headers: this.headers,
        },
      },
      // The State TrackingManager which the UndoRedo widget in the toolbar uses
      stm: {
        autoRecord: true,
      },

  listeners: {
    // listen to load request errors
    loadFail: this.processError,
    // listen to sync request errors
    syncFail: this.processError,
  },
};

this.project = project;

Post by mats »

Please read this section: https://bryntum.com/docs/gantt/#Gantt/guides/integration/angular.md#bryntum-gantt-api-instance

Once you learn how to access the Gantt instance, simply do:

gantt.taskStore

Post Reply