Filter and reload of the gantt data issue

Hi,

We are filtering the data to be shown on gantt chart based on the user selected filters on the screen.Upon filter selection we are making an ajax call and reloading the gantt. Gantt div has height and width set to 100% and autoresize to true on gantt.Below is the code which we use for the filtering:

gantt.clearAll(); gantt.refreshData(); intializegantt(source);

intializegantt function - has the gantt initialization code like attach events, column configuration and init and parse the datasource.

When we load the data for the first time, the gantt loads fine. But when we reload based on the filters the below issues occur:

  1. Gantt reset the grid columns to the default view(Task Name, start Time, Duration, add), but does not show the columns that we configured.
  2. It changes the scale that we used and shows the default scale that is being used in the most of the samples like below link:
    [url]http://dhtmlx.com/docs/products/dhtmlxGantt/02_features.html[/url]
  3. We are getting very small scroll(vertical) where we could not even see the content in the grid and gantt.(attached the image for the same)
    4.On all the next reload throws error at the below line while rendering, and rest of the code stops executing.
this.$scroll_hor.firstChild.style.width = (task_data_width + grid_width + scroll_size + 2) + "px";

Please note that we are using gantt 3.3 enterprise edition, and this is not the case with GPL 3.3 version

Need urgent help on this.

Thanks in Advance for any inputs.


Hello,
if you reload filtered data from the server side, you don’t need to reinitialize gantt.
Something following should work:gantt.clearAll(); gantt.load("filtered data url");
or:

gantt.clearAll();// remove current data $.ajax({ url:"filtered data url", ... success: function(data){ gantt.parse(data); // put loaded data into the gantt } });
Probably some issue happens when you perform initialization several times