Premium support for our pure JavaScript UI components


Post by Gowtham »

Hi,
We need to load data for all the store from a api, so we have used the below approach to clear and reload the project data assigned to Gantt and SchedularPro. In that approach we are getting the idCollision issue on second time loading PFA. Attached the same project for loading the data.

var xhr = new XMLHttpRequest();
        xhr.open("GET", "resources/launch-saas.json");
        xhr.onload = () => {
          let result = JSON.parse(xhr.response);
          project.timeRangeStore.clear();
          project.calendarManagerStore.clear();
          project.resourceStore.clear();
          project.taskStore.clear();
          project.assignmentStore.clear();
          project.dependencyStore.clear();
          project.timeRangeStore.add(result.timeRanges.rows);
          project.calendarManagerStore.add(result.calendars.rows);
          project.resourceStore.add(result.resources.rows);
          project.taskStore.add(result.tasks.rows);
          project.assignmentStore.add(result.assignments.rows);
          project.dependencyStore.add(result.dependencies.rows);
          project.setCalendar(result.project.calendar);
          project.setStartDate(result.project.startDate);
          project.setHoursPerDay(result.project.hoursPerDay);
          project.setDaysPerWeek(result.project.daysPerWeek);
          project.setDaysPerMonth(result.project.daysPerMonth);
        };
        xhr.send();
Attachments
Gantt-schedulerpro.zip
(3.18 MiB) Downloaded 60 times
ID Collision Error
ID Collision Error
ID-Collision.png (261.18 KiB) Viewed 450 times
Last edited by Gowtham on Wed Apr 21, 2021 11:27 am, edited 1 time in total.

Post by mats »

Try instead using inlineData setter to load everything in just one statement: https://bryntum.com/docs/gantt/#Gantt/model/ProjectModel#property-inlineData

// Get data from server manually
const data = await axios.get('/project?id=12345');

// Feed it to the project
gantt.project.inlineData = data;

Post by Gowtham »

As suggested, the inlineData for IDCollision issue is worked fine and we have removed the schedularPro instance and added the resource histogram. On second time data load we got another issue mentioned below. Post this issue we are unable to perform any operation on the Gantt.

unknown identifier [object object]
unknown identifier [object object]
UnknownIdentifier.png (180.79 KiB) Viewed 401 times
Last edited by Gowtham on Wed Apr 21, 2021 11:24 am, edited 1 time in total.

Post by mats »

Ok please start a new thread for this, and any other issue you find.


Post Reply