We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Gantt waiting popup

Hi,

I want to activate a waiting popup when dinamically updating gantt data. I want it to spin during the data loading time. I'm trying using ej-waitingpopup, but I'm unable to make this. Could you please provide a system or example to get this?

Thanks.

11 Replies

PE Punniyamoorthi Elangovan Syncfusion Team December 5, 2018 01:19 PM UTC

Hi Oscar, 
Thank you for contacting Syncfusion support.  
Due to JavaScript Synchronous behavior the waiting popup loader animation will be halted when updating the Gantt control with datasource. Since we are processing the Gantt data in client side with JavaScript calculations.  
Please get back to us know if you require further assistance on this.  
Regards,  
Punniyamoorthi 



OB oscar bartolome December 11, 2018 10:05 AM UTC

Hi,

is it not possible to do it? Our data amount sometimes is big enough to make the app freeze for a while, so it would be fine to show any loading popup.

Any idea to solve it?

Thanks


PE Punniyamoorthi Elangovan Syncfusion Team December 11, 2018 01:42 PM UTC

Hi Oscar, 
In Gantt there is load  and create client side events are available, the load event will triggered while Gantt is initiate the rendering and create event will triggered when Gantt is rendered completely. We have prepared the sample for rendering the waiting popup in load event and hidden that popup in create event, but the waiting popup didn’t render due to the JavaScript is not ideal. Because the Gantt is rendering with JavaScript calculations. We have prepared the sample for your reference, please find the sample link below 
Regards, 
Punniyamoorthi 
 



OB oscar bartolome December 11, 2018 02:07 PM UTC

Hi,

and so the answer is that it is not possible to show a loading popup during the gantt data loading?  Not even using any kind of service or http interceptor?

Thanks


JA Jesus Arockia Sankaran S Syncfusion Team December 12, 2018 12:45 PM UTC

Hi Oscar, 
 
We could render waiting popup using “load” and “actionComplete” client-side event in Gantt.  To render the waiting popup, we need to populate the data by using ejDataManager.  
 
Code Snippet: 
[html] 
<ej-waitingpopup id="popup" ></ej-waitingpopup>  
<div id="ganttParent"> 
<ej-gantt id="GanttControl" [dataSource]="dataManager" (load)="load($event)" (actionComplete)="actionComplete($event)" > 
</ej-gantt> 
</div> 
 
[ts] 
export class AppComponent { 
    public ganttData: any;  
    public dataManager:any;    
    constructor() {                         
             this.dataManager = ej.DataManager(this.ganttData); 
    }    
   load(e: any) { 
       var obj = $("#popup").data("ejWaitingPopup"); 
       obj.setModel({showOnInit: true,target: "#ganttParent"});     
    } 
   actionComplete(e: any) { 
            if(e.requestType == "create"){                  
                         var obj = $("#popup").data("ejWaitingPopup");                            
                          obj.hide(); 
       }     
    } 
} 
 
 
Please get back to us if you require any further assistance on this. 
 
Regards, 
Jesus Arockia Sankaran S 



OB oscar bartolome December 12, 2018 02:07 PM UTC

Hi,

could you please provide an example that ej.DataManager loads remote data instead of local data, like this:

        var data = [];

this.dataManager = new ej.DataManager({
url: me.config["integraAPIUrl"] + "/api/v1.0/production/productionData/workshop",
async: false,
crossDomain: true,
});

var query = new ej.Query();
var dataObj = this.dataManager.executeQuery(query);

dataObj.done(function (e) {
data = e.result;
});

It doesn't seem to show waiting popup with remote data.

Thanks



JA Jesus Arockia Sankaran S Syncfusion Team December 13, 2018 01:26 PM UTC

Hi Oscar, 
 
Thank you for your update. 
 
We have checked your code snippet. As per your requirement, we have prepared the sample with remote data instead of local data. 
 
Code Snippet: 
[TS] 
export class AppComponent { 
    public ganttData: any; 
      public dataManager: any; 
    constructor() { 
        this.dataManager = new ej.DataManager({ 
            url: "http://internaldemo.syncfusion.com:8072/", 
            async: true, 
            crossDoamin: true 
        }); 
    } 
 
    public treeColumnIndex = 1; 
    load(e: any) { 
        $("#ganttParent").ejWaitingPopup({ showOnInit: true }); 
    } 
    actionComplete(e: any) { 
        if (e.requestType == "create") { 
            var obj = $("#ganttParent").ejWaitingPopup("instance"); 
            obj.hide(); 
        } 
    } 
    
} 
 
 
Note: We suggest you to provide the async value as “true” in the dataManger, if we set async value as “false” then the JavaScript will wait for server side response, so the waiting popup will not showing.  
 
Please get back to us if you require any further assistance on this. 
 
Regards, 
Jesus Arockia Sankaran S 



OB oscar bartolome December 13, 2018 02:08 PM UTC

Hi,

if I try using asyc property as true, the data is not rendered in the gantt. Besides, you told me to use async property as false in the previous topic:

https://www.syncfusion.com/forums/138577/datamanager-for-resources

Any idea why the data is not rendered?

Thanks


JA Jesus Arockia Sankaran S Syncfusion Team December 14, 2018 12:32 PM UTC

Hi Oscar, 
 
Thanks for the update. 
 
We insist you to confirm us that whether the data fetched form the following URL {url: me.config["integraAPIUrl"] + "/api/v1.0/production/productionData/workshop”} is a data source collection or data source collection and resource collection. For your reference, We have prepared a sample for assuming that the URL only returning the data source collection. 
 
Code Snippet: 
 
[TS]  
export class AppComponent {  
    public ganttData: any;  
      public dataManager: any;  
    constructor() {  
        this.dataManager = new ej.DataManager({  
            url: "http://internaldemo.syncfusion.com:8072/",  
            async: true,  
            crossDoamin: true  
        });  
    }  
} 
 

Please get back to us if you require any further assistance on this. 
 
Regards, 
Jesus Arockia Sankaran S 



OB oscar bartolome December 14, 2018 12:40 PM UTC

Hi,

we have two calls:

One for the data:

        this.dataManager = new ej.DataManager({
url: me.config["integraAPIUrl"] + "/api/v1.0/production/productionData/workshop",
async: false,
crossDomain: true,
});
var query = new ej.Query();
var dataObj = this.dataManager.executeQuery(query);
dataObj.done(function (e) {
data = e.result;
});

And another for the resources:

        this.resourcesManager = new ej.DataManager({
url: me.config["integraAPIUrl"] + "/api/v1.0/production/workcenters",
async: false,
crossDomain: true
});
var query = new ej.Query();
var resourcesObj = this.resourcesManager.executeQuery(query);
resourcesObj.done(function (e) {
resources = e.result;
});

Thanks




JA Jesus Arockia Sankaran S Syncfusion Team December 17, 2018 01:04 PM UTC

Hi Oscar, 
 
We have checked your code snippet. We suggest you to provide the dataSource to the Gantt control directly using DataManager without done function. 
 
Code Snippet: 
[TS]  
export class AppComponent {  
      public ganttData: any;  
      public dataManager: any;  
      constructor() {  
        this.dataManager = new ej.DataManager({  
            url: "http://internaldemo.syncfusion.com:8072/",  
            async: true,  
            crossDoamin: true  
        });  
    }  
} 
 
Also, we suggest you to pass the resource collections using DataManager and “async” value as false with done function.  
 
Code Snippet: 
constructor() {  
        this.projectResources  = this.getResources();  
    }  
getResources() { 
         
        var resources = []; 
        var dataManager = new ej.DataManager({ 
            url: "http://internaldemo.syncfusion.com:8094/", 
            async: false, 
            crossDoamin: true 
        }); 
        var query = new ej.Query(); 
        var dataObj = dataManager.executeQuery(query); 
        dataObj.done(function (e) { 
            resources = e.result; 
        }); 
        return resources 
    }   
 
Note: If we pass the large resource collection with async value as “false” then the waiting popup may not be rendered due to the JavaScript will waiting for server side response. 
 

Please get back to us if you require any further assistance. 
Regards, 
Jesus Arockia Sankaran S 


Loader.
Live Chat Icon For mobile
Up arrow icon