State Tracking Manager Implementation
- rahulranjan
- Premium Member
- Posts: 497
- Joined: Mon Apr 29, 2019 8:43 pm
State Tracking Manager Implementation
I have not used crud manager.
So when i this.gantt.taskStore.changes . In modified it gives all the present record.
It is Angular Project
Run the project
Click on Save button two new column will get added .
Do editing of columns cell
Click on change button
You will see the task in console .
I think because of state tracking manager is not implement i am not able to achieve. Please let know without transport and curd manager how can we implement STM in this use case.
So when i this.gantt.taskStore.changes . In modified it gives all the present record.
It is Angular Project
Run the project
Click on Save button two new column will get added .
Do editing of columns cell
Click on change button
You will see the task in console .
I think because of state tracking manager is not implement i am not able to achieve. Please let know without transport and curd manager how can we implement STM in this use case.
- Attachments
-
- advanced2.rar
- (1.83 MiB) Downloaded 11 times
Re: State Tracking Manager Implementation
Actually, there is no relation between STM (State Tracking Manager) and CrudManager. STM tracks changes in the registered stores and provides undo/redo logic. This works until you click Save because on successful save the all changes are cleared.
Please use our angular/advanced example that implements STM as a starting point.
Also, information in this post may help. It is from Ext STM but the approach is same.
Please use our angular/advanced example that implements STM as a starting point.
Also, information in this post may help. It is from Ext STM but the approach is same.
- rahulranjan
- Premium Member
- Posts: 497
- Joined: Mon Apr 29, 2019 8:43 pm
Re: State Tracking Manager Implementation
Hi Saki
Thanks for info
I have gone through examples as in example it shows to enable stm after project load which i am using.
What i am looking once all the data gets loaded then tracking should happen in taskStore. And i should get changed records only
If something fails i should revert/undo the changes. As in above attach project i can i achieve . Need help.
Thanks for info
I have gone through examples as in example it shows to enable stm after project load which i am using.
Code: Select all
project.load().then(() => {
// console.timeEnd("load data");
const stm = gantt.project.stm;
stm.enable();
stm.autoRecord = true;
Code: Select all
this.gantt.taskStore.changes
- sergey.maltsev
- Core Developer
- Posts: 683
- Joined: Mon Dec 24, 2018 9:15 am
Re: State Tracking Manager Implementation
Hi, rahulranjan!
Sorry it is not quite clear what is the test case you are trying to describe in first post.
STM usage with Gantt can be checked in several demos.
Please check them before asking further questions related to STM.
Almost all shows how to revert or reapply changes.
https://www.bryntum.com/examples/gantt/advanced
https://www.bryntum.com/examples/gantt/undoredo
Also this is demo which uses server backend and STM (should be compiled locally)
examples/php/
STM docs are here
https://www.bryntum.com/docs/grid/#Common/data/stm/StateTrackingManager
P.S. To fix Gantt toolbar height just add this owner: gantt, to it's config.
examples/angular/advanced2/src/app/gantt/ganttToolbar.ts
Sorry it is not quite clear what is the test case you are trying to describe in first post.
STM usage with Gantt can be checked in several demos.
Please check them before asking further questions related to STM.
Almost all shows how to revert or reapply changes.
https://www.bryntum.com/examples/gantt/advanced
https://www.bryntum.com/examples/gantt/undoredo
Also this is demo which uses server backend and STM (should be compiled locally)
examples/php/
STM docs are here
https://www.bryntum.com/docs/grid/#Common/data/stm/StateTrackingManager
P.S. To fix Gantt toolbar height just add this owner: gantt, to it's config.
examples/angular/advanced2/src/app/gantt/ganttToolbar.ts
Code: Select all
const getDefaultConfig = gantt => {
return {
owner: gantt,
...
- rahulranjan
- Premium Member
- Posts: 497
- Joined: Mon Apr 29, 2019 8:43 pm
Re: State Tracking Manager Implementation
Hi Thanks for you replay
Let me explain you you are enabling stm after project load right ?
Like below code
I my case you see i am loading the data and setting up in respective stores. You see in attachment . So what i want to ask in this case where to enable stm recording.
Let me explain you you are enabling stm after project load right ?
Like below code
Code: Select all
project.load().then(() => {
const stm = gantt.project.stm;
stm.enable();
stm.autoRecord = true;
- rahulranjan
- Premium Member
- Posts: 497
- Joined: Mon Apr 29, 2019 8:43 pm
Re: State Tracking Manager Implementation
Any Updates on this
Re: State Tracking Manager Implementation
The STM must be enabled only after all project data is loaded. Otherwise it would start to monitor empty store and and the load itself would be recorded as the changes that can be undone.
- rahulranjan
- Premium Member
- Posts: 497
- Joined: Mon Apr 29, 2019 8:43 pm
Re: State Tracking Manager Implementation
Hi Saki
I am first loading store data and then putting it in respective store under Project.
Select the task
Click on Edit task
Change the name
Click on Save
In console it always gives all the as modified even if you don't modify
In this case where to enable stm tracking and how to get added, modified and remove data.
This i want to do for all store
I am first loading store data and then putting it in respective store under Project.
Select the task
Click on Edit task
Change the name
Click on Save
In console it always gives all the as modified even if you don't modify
In this case where to enable stm tracking and how to get added, modified and remove data.
This i want to do for all store
- Attachments
-
- advanced02.rar
- (1.83 MiB) Downloaded 16 times
- Maxim Gorkovsky
- Core Developer
- Posts: 3307
- Joined: Wed Jan 08, 2014 11:46 am
Re: State Tracking Manager Implementation
Hello.
When you load data from remote URL project would normally commit that data. But when you load data inline, you need to call it yourself:
When you load data from remote URL project would normally commit that data. But when you load data inline, you need to call it yourself:
Code: Select all
// @ts-ignore
project.propagate().then(() => {
project.taskStore.commit();
project.dependencyStore.commit();
});
this.gantt = new Gantt({
...ganttConfig,
project: project
});
- rahulranjan
- Premium Member
- Posts: 497
- Joined: Mon Apr 29, 2019 8:43 pm
Re: State Tracking Manager Implementation
Thanks a lot i work lot
One problem still i am facing
Steps
Go the task select the task , edit the task
Select the predecessor tab . add predecessor and click save
Dependency will only give modified and removed task , As i am adding it is giving empty array for it
One problem still i am facing
Steps
Go the task select the task , edit the task
Select the predecessor tab . add predecessor and click save
Dependency will only give modified and removed task , As i am adding it is giving empty array for it
- Attachments
-
- advanced02.rar
- (1.84 MiB) Downloaded 16 times