New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating tasks in onBeforeTaskEdit
is not possible if returning false
#7056
Comments
@taauntik any news in this item ? It's very important for us. |
@Jmurawsk We'll try to take a look soon. We haven't seen this before though, can you please explain the use case and why tasks need to change before you edit? |
@matsbryntse We would like to replace Bryntum Gantt Editor for tasks and place our Custom Editor. After implementation when we open our custom editor and save the data we observed our changes are not reflected in the Gantt. We can see new data are updated for a second in the Gantt and then disappear with previous data. |
Replacing the Gantt editor is reasonable yes, but why load new data into the Gantt when editing starts. What's the reasoning behind it?
This sounds like the root cause to investigate, likely the custom editor is not properly implemented when it comes to writing data to the task being edited. |
@matsbryntse We would like to take new data and show them in Gantt because we made change in data structure. Previously I checked if maybe we can use onAfterTaskEdit event but unfortunately it was not triggered in this case. |
Ok so to sum up, after you have finished editing in your custom editor, the data is not updated in the Gantt - correct? Then it would be better to focus on fixing that issue. And then this issue would not matter I suppose? If you could open a ticket in our forum to share your code of how you do your custom editor - we can try to review and see how to fix it. |
@matsbryntse we provided reproducible scenario in this item https://forum.bryntum.com/viewtopic.php?p=126442#p126442 |
I believe we're missing your custom editor where the data saving isn't working properly. |
@matsbryntse It was me who created this support request on the Bryntum forum. And we don't need any custom editors at all to reproduce this issue. I've provided 4 clear steps how to rerpoduce this issue from the initial Bryntum Gantt setup and also provided my question about it (https://forum.bryntum.com/viewtopic.php?p=126442#p126442):
Then @taauntik has confirmed that he was able to reproduce this issue based on my 4 steps which I provided in the forum and created this GitHub's issue. And you can find the reproducible scenario by @taauntik in the very first message of this GitHub's issue. |
We’d first like to understand why you would want to load new data into the Gantt when editing starts. Never seen anyone do this |
Please consider the folowing scenario: a user clicks the Edit button and then the app recieves the tasks updates via the API call. |
onBeforeTaskEdit
is not possible if returning false
Ok, thanks for clarifying. Fix/test added, waiting for test suite results. |
Forum post
Hello,
We use React and store tasks in the component's state of our application and use inline data feature to pass tasks to the Gantt component.
We have a requirement to display a custom window instead of the Task Edit window when a user click the Edit button on a task. And we also need to update tasks in this case. So we use onBeforeTaskEdit event and update tasks state in this event. But we noticed that after calling 'return false' on the function for this event (we call it to prevent showing the "Task Edit" window), the tasks changes rollback to the initial state which was before update.
The onAfterTaskEdit event works properly for us but it is called only when the Task Edit window has been closed but we want to hide it.
So my question is how can we prevent rollback changes for tasks in the beforeTaskEdit event and hide Task Edit window at the same time?
You could reproduce it locally here
Gantt\examples\frameworks\react\javascript\inline-data
App.js
filechrome_M9IWMGAPgL.mp4
The text was updated successfully, but these errors were encountered: