Our state of the art Gantt chart


Post by SIM-LTD »

Hi there,

We are having a serious issue when it comes to organizing the Gantt Task :(

Indeed, the Gantt Task can be resequenced by dragging the task from the Grid part before or after other.
Then WBS number is changed accordingly. so far so good.

As we have a listener on the "TaskStore" in order to capture every single change that is broadcasted in a database :
            gantt.taskStore.on({
                change        : this.myGanttTaskStoreChange,
            })
The big issue for us is we wonder why you need to fire 2 events when a Task is dragged from the Gantt grid.
Have a glance at our screenshot.
  • The first one is an event "Remove"
    The second one is an event "Add"
Just think a couple of second about that process... :o
As a matter of fact, if dragging one task leads to get 2 events: "Remove" and "Add";
thus, how it is possible to distinguish an event which is simply deleted or added? :twisted:
With that process "Remove" and "Add", the task would be deleted from the database, with all its dependencies... and then afterward created !!! This does not make sense at all.

Secondly, would not it be wiser to change only the 'index' or 'WBS', instead of having 2 events "Remove" & "Add"
Indeed, dragging a task from the grid would have as outcome an event "update" that is fired with only the index or WBS number updated accordingly.

Any suggestion to overcome that issue?
Attachments
Capture d’écran 2019-08-04 à 00.09.04.png
Capture d’écran 2019-08-04 à 00.09.04.png (97.7 KiB) Viewed 2443 times

Post by SIM-LTD »

Any news about this big issue?

Post by Maxim Gorkovsky »

Hello. Sorry for long response.
As I understood, your problem is that you cannot tell from sequence of remove/add events if task was actually removed, or just moved to another branch.
Good news is that in coming gantt release it would be possible with isMove parameter on remove event. Latest grid release already has that change, as you can see in this doc.

So, in coming 1.1.3 release you would be able to do this:
taskStore.on({
  remove({ records, isMove }) {
    if (!isMove) { removeFromDatabase() }
  },
  add({ records, isMove }) {
    if (!isMove) { addToDatabase() }
  }
}) 
Unfortunately, not so easy in the current release.

Post by Maxim Gorkovsky »

Also we have a ticket to replace remove/add sequence with single move, where it is possible: https://app.assembla.com/spaces/bryntum/tickets/9000-grid-drag-drop-should-use-store-move-where-possible-/details

Post by SIM-LTD »

Hi Maxim

You totally get the point. Thank you very much

It is a real relief to hear that in the next release this will be possible because, as you have guessed in the current version is impossible to do that and that was a major problem.

Without telling you all about our implementation, our core solution is based on realtime, thus whenever a user edit (Add/Update/Delete) an item (Task / Dependencies / Assignment ) all users connected see the changes in realtime. anyway.
We do not use the Standard CRUD Management, but something a bit more sophisticated that allow us to store the Gantt in SQL database.
and then push to all changes toward all devices connected...

Thank you for having taken a moment to answer.

Is it possible to know when the Gantt 1.1.3 will be issued?

Post by Maxim Gorkovsky »

We have plans to release new gantt in the coming weeks.

Post by SIM-LTD »

Hi

As per your answer August 8th, you were supposed to release a Gantt where that issue would be fixed.
The last release Gantt 1.1.4 brought a new property 'isMove'.

This property allowed us to distinguish when the Item was "Removed" and "Added" from the simple Drag&Drop (Drop an Item to a parent) Task from the Grid

As a matter of fact, the main issue we had when sequencing the Task in the Grid then both Remove/Add event was fired. Now with that property 'isMove' we can make a specific test to avoid deleting and recreating the task (in terms of Database point of view).

The question is why this property 'isMove' is Boolean type when the Item is removed and Object type when the Item is Added (Have a look at the screenshot)?

If we raise that question is mainly because, when an Item is added (not from that process of resequencing...) then there is a property 'isMove' as an object (see the screenshot) and not a boolean. Moreover, the object seems to be a random property that we cannot test either.
Then the workaround you have proposed (see above) is not accurate and does not work accordingly.
So the record was added into database instead of being updated with the new index (or sequence or WBS)

Then having a test on 'isMove' taking into account that property has 2 types (Boolean or Object) makes the thing more complicated...

Will the next Gantt Release fixe that issue (Drag & Drop Task from the Grid should not fire 2 events (Remove/Add)
Because that simple process should only run an update of the Index (or Sequence or WBS...) and not at all run 2 processes "Remove" and then "Add"
Attachments
Capture d’écran 2019-10-13 à 19.43.08.png
Capture d’écran 2019-10-13 à 19.43.08.png (28.62 KiB) Viewed 2262 times
Capture d’écran 2019-10-13 à 18.28.10.png
Capture d’écran 2019-10-13 à 18.28.10.png (58.97 KiB) Viewed 2263 times

Post by Maxim Gorkovsky »

Hello.
Thank you for report, ticket opened here: https://app.assembla.com/spaces/bryntum/tickets/9371-ismove-in-%60add%60-event-is-not-a-boolean-but-always-an-object/details
There are plans to introduce 'move' event as you expect, but no milestone set yet. You can subscribe to this ticket to stay in touch: https://app.assembla.com/spaces/bryntum/tickets/7270-moving-a-node-within-a-tree-should-trigger--quot-move-quot-/details

Post by Animal »

It looks like we made a documentation error. Sorry about that.

Because multiple records may be added, and a single event is fired for the whole add operation, we need to determine which of the records is in fact moved from another point in the store and which are new.

So it has to be an object keyed by the record ids.

This property is now documented like this:
Screenshot 2019-10-31 at 13.47.51.png
Screenshot 2019-10-31 at 13.47.51.png (286.21 KiB) Viewed 2224 times

Post Reply