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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

expandAtLevel

Thread ID:

Created:

Updated:

Platform:

Replies:

132331 Aug 26,2017 04:29 PM UTC Aug 28,2017 11:35 AM UTC Angular 1
loading
Tags: ejGantt
Marko
Asked On August 26, 2017 04:29 PM UTC

Hi,

is there any similar function to expandAtLevel from Grid?
Curently I have the following part of function, which expand records to number level and colapse others:
for(let item of args.model.flatRecords){
if((item.level < number && !item.expanded) || (item.level == number && item.expanded))
ganttObj.expandCollapseRecord(item.taskId);
}
and this works OK, but it becom slow, when I have 500+ records in my Gantt.
So is there any better way?

Regards,
Marko


Suriyaprasanth Ravikumar [Syncfusion]
Replied On August 28, 2017 11:35 AM UTC

Hi Marko, 
Please find the response below. 
Query 1: is there any similar function to expandAtLevel from Grid? 
Answer: At present, there is no method available to expand/collapse the record at specific level in Gantt. For this we have already logged a feature report as” Public method support to expand/collapse records at specific level”. This feature will be included in our upcoming volume 4, 2017 main release which will be expected to out at end of October, 2017. 
 
Query 2: but it become slow, when I have 500+ records in my Gantt. 
Answer: We can overcome this performance delay by enabling virtualization support in Gantt. We can enable this by set “enbleVirtualization” property as true. 
As per your requirement we have prepared a sample and reduced the time delay on expand/collapse action. 
We have achieved by using “enableVirtualization” property and by preventing the unwanted execution of “expandCollapseRecord” public method by checking whether it contains child records or not. 
Please refer the following code snippet. 
[HTML] 
<ej-gantt id="GanttControl" [dataSource]="datasource" [enableVirtualization]="true" 
            //... 
> 
</ej-gantt> 
<button (click)="expandCollapse(1)">Expand/Collapse</button> 
 
[TS] 
    public expandCollapse(Number?: number) { 
        var ganttObj = $("#GanttControl").ejGantt('instance'); 
        for(let item of ganttObj.model.flatRecords){ 
            if (item.hasChildRecords && ((item.level < Number && !ganttObj.getExpandStatus(item)) || (item.level == Number && ganttObj.getExpandStatus(item)))) 
                ganttObj.expandCollapseRecord(item.taskId); 
        } 
    } 
Please find the sample from below location. 
Please let us know if you require further assistance on this. 
Thanks, 
Suriyaprasanth R.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;