Our state of the art Gantt chart


Post by Bhava »

Hi ,
We have customized the task edit popup where we created a new store (called Team Store) which contains all the grid information for all the tasks .On Clicking the taskbar, we are loading the grid information in a new store(that is the current Store) which is a filtered form of the Team store .

 loadEvent(record) {           
this.store.data = teamStore.data.filter( (obj) => obj.taskid === record.id ); },

Here we are applying crud operations where we do addition , deletion, and updating for the task records. Here we are able to get changes [added, modified, removed] for both the current Store and Team Store .

What we need is when we apply save, the values should be added to the main store. and on opening the task edit again that should be reflected, as a normal task edit save function. if we don't save, no changes to be added reflecting the previous one. We tried teamStore.commit() on save but the changes are not getting updated in the store.

how to achieve this?

Attachments
taskeditpopup.png
taskeditpopup.png (12.91 KiB) Viewed 568 times

Post by alex.l »

Sounds like that's what you need: https://bryntum.com/docs/gantt/#Core/data/mixin/StoreChained

A chained Store contains a subset of records from a master store. Which records to include is determined by a filtering function, chainedFilterFn.

All the best,
Alex


Post by Bhava »

No
What I need is how to save the changes in popup taskeditor on clicking save button.


Post by alex.l »

Could you please attach a runnable test case here? It should just work if you applied your changes to a record in a store and commit changes.
It may be useful to check our examples. This one has been implemented for the Scheduler (you can download a trial and check the sources) with completely custom task editor. I hope it helps you. https://bryntum.com/examples/scheduler/frameworks/react/javascript/custom-event-editor/build/index.html

All the best,
Alex


Post by Bhava »

hi, need one more info.

loadEvent(record) {           
this.store.data = teamStore.data.filter( (obj) => obj.taskid === record.id ); },

)
if I load the popup store as above, when i do some modifications to the existing data it is getting stored in the (currentStore.changes.modified) to the current store. and also it is reflecting it in the teamStore. but it is not happing for added and removed. only on modifying the records the teamStore is also getting the changes in (teamStore.changes.modified) is it possible to stop the modification for teamStore(main store)


Post by Maxim Gorkovsky »

Hello.
store.data is supposed to return raw initial data, so any changes you make to records in this.store should not be reflected on the teamStore. Unless you have other code you do not show in this snippet that is responsible for syncing changes.

is it possible to stop the modification for teamStore(main store)

Do I get it right you want this.store and teamStore to be untangled completely?


Post Reply