Discuss anything related to web development but no technical support questions


Post by Vitaliy Nesterenko »

In our company we are using Bryntum Gantt 4 with undo/redo manager (Gnt.data.undoredo.Manager). It works almost fine, but we have difficulties in theese situations:

1) Create new task, click undo. It the Network tab i see it sends
tasks:
   updated : [{Id: "Csp.model.Task-1"}]
How should we process it on backend, if there is no task with this phantom id ? Or we should have been stored this phantom id on creation, and after undo hit just find this task by phantom id and delete it.

2) Delete existing task, click undo. In the Network tab nothing happend. Thought it restored the deleted task in the grid, on the next sync it would not be here. How show we handle deletion undo if it does not send anything?

Post by mats »

Please don't post more than once about same issue

Post by Maxim Gorkovsky »

I could not reproduce this issue on latest gantt code in advanced example. What version do you have? We will need a runnable test case or steps to reproduce on our examples.

Post by Vitaliy Nesterenko »

Thank you for the fast reply. Our version Ext Gantt Pro 4.1.2. Can it be due to the version? I'll try to create the example and post here later.

Post by Maxim Gorkovsky »

Probably, latest version is 4.2.4, try it first, you can get it from customer zone.

Post by Vitaliy Nesterenko »

Ok, we shall try it later.
One more question: are there any description for format used to sync tasks in Gantt ?
I tried to implement example using advanced-gantt, but for undo/redo to work i need a backend. So i've made a simple Express Js script to listen on port and accept post requests. But i do not know what should i send on post reqest (what fields, format) ? For example i hit add task button, it sends me something like tasks: { added: [...}. What am i supposed to send back? I sent some arbitrary JSON, and it's ok - no error on client. But when i hit undo, it does not send anything.

Post by Maxim Gorkovsky »

Check our guide, load/sync response structure is described there. You can also take a look at advanced example for load request or PHP/.NET/Java demo to see how we handle both load and sync.

Post by Vitaliy Nesterenko »

I've made up test example (advanced.zip archive) it contains advanced example almost unchanged. I just change autoSync of CrudManager to true, and set transport url for "sync" method. And there is a serv.js file which serves as a dummy backend - it sends valid response in case of adding new task.

Test scenario:
1) unpack, npm install (it should install express js and body-parser)
2) run from command line
node serv.js
3) go to localhost:9090
4) Add new task (click + button on top), hit enter (do not change name)
6) Look at the network tab, there should be server response 200
5) Hit undo button
6 Look at the network tab, i do not see any requests, should it be there?

Example uses trial version 4.2.4 (our subscription expired, and we are in the process of purchasing new one)
I also tried this example with 4.1.2 and it worked differently, it sends request on undo, as i described in the first post.
Attachments
advanced (1).zip
(1.58 MiB) Downloaded 266 times

Post by Vitaliy Nesterenko »

You were asking for a runnable test, so i've made one. Or runnable meens i should host it some somewhere?
Please tell what else should i do to get help with my issue.

Post by Maxim Gorkovsky »

Sorry for long response, we are looking into this and will respond you soon.

Post Reply