This is a migrated thread and some comments may be shown as answers.

Can't get handle to Gantt data/error handling

2 Answers 119 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
Kris
Top achievements
Rank 1
Kris asked on 26 Aug 2015, 11:42 PM

I've been working on some error handling routines for in the event of a service failure, and have two questions as a result.

When the service fails, my error handler works as expected, and I'm able to get the error message from e.xhr.responseText. However, I have batch set to true in the Angular controller for the Gantt object, and the next time I make an update request, it's compounding the data with the failed request. I'd like to have control over whether to keep this data for the next request, or clear it on fail.

The other part of the issue is that when I hover over a Task, the information in the tooltip reflects the changed information that went out in the failed update, however, the view (position and size of the Task object) reflects the old data, so now I have an inconsistency between my model and my view. I tried to just call the refresh() method, but ran into the following problem:

var gantt = $("div[data-role='gantttimeline']"), // returns HTML element as expected
  ganttData = $("div [kendo-gantt]").data("kendoGantt"); // returns null, can't call refresh()

So, to recap, two issues. First of all, how can I clear the failed request from the queue and roll back the data in my model? Secondly, how can I get a handle on the Gantt data? All the examples that I could find use the above method, but they're also using Javascript to instantiate the object, where as I'm using Angular with a controller.

 Thanks in advance for your help!

 

 

2 Answers, 1 is accepted

Sort by
0
Kris
Top achievements
Rank 1
answered on 26 Aug 2015, 11:44 PM

Oops, can't edit my last post, but I spotted a mistake in the code snippet. It should be:

var gantt = $("div [kendo-gantt]"), // returns HTML element as expected
  ganttData = $("div [kendo-gantt]").data("kendoGantt"); // returns null, can't call refresh()
 

Sorry about that.

0
Bozhidar
Telerik team
answered on 31 Aug 2015, 06:25 AM
Hello,

Could you open a support ticket and send a sample project that we can inspect, so that we can observe the same issues you are encountering? 

Regards,
Bozhidar
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Gantt
Asked by
Kris
Top achievements
Rank 1
Answers by
Kris
Top achievements
Rank 1
Bozhidar
Telerik team
Share this question
or