Our state of the art Gantt chart


Post by rahulranjan »

How can i use Store Curd Event

Post by mats »

Sorry, this is not a valid question. Please describe your question in more words.

Post by rahulranjan »

I want to get the data from add events of Store Curd. https://www.bryntum.com/docs/gantt/#Com ... #event-add

So how can i assign this event . to store and fire it when records are added.

Post by rahulranjan »

Hi
project.assignmentStore.on('beforeAdd', function (store) {
      // console.log(store);
      const taskType = store.records[0].event.type;
      if (taskType === 'wbs') {
        WidgetHelper.toast('You can not assign resource at wbs');
        store.removeAll();
      } else {
        //console.log(store);
        //  this.AssignResource(store);
        WidgetHelper.toast('Resource is Assign');
      }
    });
I don't want to assign resource at wbs level only at activity level but this gives error? am i going in the right direction or some other way we can implement it.

Post by mats »

at wbs level
By this you mean a **parent task** ?

Post by rahulranjan »

Yes parent task i should be able to add resources

Post by mats »

Sorry don't understand. Where in your tree is where you don't want to allow resource assignment, you say *wbs level only* - what is this in the task tree?

Post by rahulranjan »

Hi

wbs
Activity1 - resource assign
Activity2 - resource assign
wbs - no resource assignment
Attachments
111111.png
111111.png (15.67 KiB) Viewed 1969 times

Post by pmiklashevich »

Hello,

You can check if a task is a parent using this property https://www.bryntum.com/docs/gantt/#Gan ... y-isParent

To prevent adding just need to return false from beforeAdd. See docs here: https://www.bryntum.com/docs/gantt/#Com ... -beforeAdd

Cheers,
Pavel

Pavlo Miklashevych
Sr. Frontend Developer


Post Reply