Our state of the art Gantt chart


Post by johanbrodin »

Hi,

We are adding a toolbar in the inline-data example using your widgets. To our understanding there is no component library documentation so a bit hard to look through other example and then trying to figure out which parameters to use.

We want the same look and feel as in the advanced example with badgets to show how many undo/redo that is available. Below is the code and please let us know which parameters to add to <bryntum-undo-redo>

   <bryntum-undo-redo
        ref   = 'undoRedo'
        type  = 'undoredo'
        [items] = '{transactionsCombo : null}'
    ></bryntum-undo-redo>
    
onUndoClick() { this.gantt = this.ganttComponent.instance; if (this.gantt.project.stm.canUndo) { this.gantt.project.stm.undo(); } } onRedoClick() { this.gantt = this.ganttComponent.instance; if (this.gantt.project.stm.canRedo) { this.gantt.project.stm.redo(); } }

Regards
Johan


Post by johanbrodin »

Adding above undo/redo widget also throws below exception in the console

main.ts:12 TypeError: Cannot read properties of undefined (reading 'isProjectConsumer')
    at UndoRedo.changeScheduler (gantt.module.js:178624:22)
    at UndoRedo.set (gantt.module.js:1850:33)
    at UndoRedo.construct (gantt.module.js:178620:7)
    at new Base$1 (gantt.module.js:2597:8)
    at new Localizable (gantt.module.js:6592:30)
    at new Events (gantt.module.js:4930:5)
    at new Delayable (gantt.module.js:16803:28)
    at new Identifiable (gantt.module.js:18487:31)
    at new Factoryable (gantt.module.js:20238:30)
    at new KeyMap (gantt.module.js:42111:19)
    
//scheduler is undefined in gantt.module.js changeScheduler(scheduler) { return scheduler.isProjectConsumer ? scheduler : UndoRedo.getById(scheduler); }

Post by alex.l »

There should be project set to bind widget with Gantt instance. It binds automatically only if undo-redo widget placed in tbar/bbar of the Gantt. In all other cases you need to specify it.
https://bryntum.com/products/gantt/docs/api/Scheduler/widget/UndoRedo#config-project

We have a bug with using standalone undo-redo widget in Angular, I will comment the ticket to notify project management about your request. Link to track the status: https://github.com/bryntum/support/issues/3789

All the best,
Alex


Post by johanbrodin »

Hi Alex,

ok then we will wait for the bug to be fixed and a good example :-)

To make it easier to get going my recommendation would be for the advanced example to have a standalone toolbar with widget as well as not using your transport. In our case we need to have control of the transport layer and since I make the assumption most of your users has the same need your key example should follow that.

Regards
Johan


Post by alex.l »

Hi Johan,

We created UndoRedo widget to simplify work with StackTrackingManager, but I understand your point as well. We will discuss your suggestion internally.

Thank you for the feedback!

All the best,
Alex


Post by saki »

Hello Johan, I was not able to reproduce the problem with the following configuration:

<bryntum-project-model
    #project
    [events] = "projectData.events"
    [resources] = "projectData.resources"
    [assignments] = "projectData.assignments"
    [dependencies] = "projectData.dependencies"
    [stm] = "stm"
></bryntum-project-model>

<div class="demo-toolbar">
    <bryntum-undo-redo
    [project]="project"
    ></bryntum-undo-redo>
</div>

<bryntum-scheduler-pro
    #schedulerpro
    [startDate] = "schedulerProConfig.startDate"
    [endDate] = "schedulerProConfig.endDate"
    [viewPreset] = "schedulerProConfig.viewPreset"
    [forceFit] = "schedulerProConfig.forceFit"
    [columns] = "schedulerProConfig.columns"
    [project] = "project"
></bryntum-scheduler-pro>

stm is {autoRecord: true} in the config file. I have used Scheduler Pro inline-data example as the starting point.

If your troubles continue, post please a runnable showcase, I hope it'll be something simple.


Post by johanbrodin »

Hi Saki,

Thank you for replaying back!

I took your code snip-it and tried it out in our code base. The exception thrown as described above did disappear however the undo/redo did not work and the widget looked very strange (we want it to look as in the basic angular example).

Then I looked at the "Schedule Pro" example however the "bryntum-project-model" did not exist so could not apply your code snip-it.

So as per your example I have put togheter a runnable project that you can download below. It is based on the angular gantt inline-data example so very small and nimble. However adding the undo/redo widget with your [project] there is a typescript error so it is not compiling.

https://agileupdatewin.s3.eu-west-2.amazonaws.com/debug/inline-data-undoredo.zip

Regards
Johan

Attachments
undo-redo.png
undo-redo.png (295.07 KiB) Viewed 473 times

Post by saki »

Hello Johan, I've dug a bit deeper and yes, it is a bug and we are working on its fixing. I has a high priority so fixing should not to take too long.


Post by johanbrodin »

Great that you can reproduce the problem! Looking forward to the fix.


Post by johanbrodin »

Hi,

Is there an update on this one? I checked 5.3.1 and it is not fixed.

According to your internal bug report you seem to have found the problem and there are multiple users asking for it.

https://github.com/bryntum/support/issues/3789

Regards
Johan


Post Reply