Hi Michele,
Thanks for contacting Syncfusion support.
In Lightswitch HTML the element Id won’t be removed while we are navigating the screen. So once we navigate back to the control from another screen more than one Id’s will exist.
So we need to remove the Gantt object in initialization to resolve this issue as shown below.
Please find the code snippet below:
// <reference path="~/GeneratedArtifacts/viewModel.js" />
myapp.Gantt.sample_data_render = function (element, contentItem) {
// Write code here.
var itemTemplate = $("<div></div>").attr('id', 'sample_data')
// Append the div element to screen
itemTemplate.appendTo($(element));
contentItem.value.oncollectionchange = function () {
if ($("#sample_data").length && $("#sample_data").data("ejGantt")) {
$("#sample_data").ejGantt('destroy');
$("#sample_data").remove();
}
We have also prepared the sample for your reference
Please find the sample from the following link:
Please let us know if you require further assistance on this.
Regards,
Jone Sherine.P.S.