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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to add extra columns in Gantt?

Thread ID:

Created:

Updated:

Platform:

Replies:

130620 May 22,2017 01:29 PM UTC May 23,2017 11:18 AM UTC Angular 1
loading
Tags: ejGantt
Marko
Asked On May 22, 2017 01:29 PM UTC

Hi,
on this page is shown how to add extra columns in gantt in js: https://www.syncfusion.com/kb/2680/how-to-add-extra-columns-in-gantt
Now I wonder, how can i do this in Angular2?

I know, that i can bind load in ej-gantt ((load)="load(args)"), but inside of my load function i can not call var columns = this.getColumns();

Thank you for your answer in advence.
Marko

Jayakumar Duraisamy [Syncfusion]
Replied On May 23, 2017 11:18 AM UTC

Hi Marko, 
Thanks for contacting Syncfusion support. 
We can get the Gantt column collection by using Gantt control instance. We have prepared a sample and added custom column in Gantt control using load event. 
Please refer the following code snippet. 
[html] 
<ej-gantt id="GanttControl" [dataSource]="ganttData"  
// 
(load)="ganttLoad($event)" 
</ej-gantt> 
[TS] 
ganttLoad = function (args) { 
        var ganttObj = $("#GanttControl").ejGantt("instance"); 
        var columns = ganttObj.getColumns(); 
var col1 = { 
            field:"column1", 
            headerText:"Column 1", 
            editType:"stringedit", 
            mappingName:"column1" 
        }, 
        col2 = { 
            field:"column2", 
            headerText:"Column 2", 
            editType:"stringedit", 
            mappingName:"column2" 
        }, 
        col3 = { 
            field:"column3", 
            headerText:"Column 3", 
            editType:"stringedit", 
            mappingName:"column3" 
        };        
        columns.splice(2,0,col1); 
        columns.push(col2); 
        columns.push(col3);         
    } 
 
Please find the sample location as below, 
Please let us know if you require further assistance on this. 
Regards, 
Jayakumar D 


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

;