UI Issues

Hello,

I have 2 separate issues. 
1. For some reason the right side of the gantt chart is adding 10px height to each row. Inspecting the page, i can see that the left and the right side have incline styles of 61px, but the right side has a real height of 71px. I manually set a row height of 61, which i am assuming is where the inline style is comming from. I have not been able to track down where the extra 10px are coming from, i was hoping there was maybe a flag or something that i unknowingly set, or didnt set that can account for this. I am able to 'fix' this by reducing the height of the left label by 10px like: 
    .e-left-label-container
        height25px !important
but this isnt ideal for me, as it requires maintenance of the rows. 


2. The right side can scroll down further than the left side. This causes miss-alignment.
To illustrate: 
Normal: 

Scrolled all the way to the bottom: 

The rows are one-to-one on purpose, and i would like them to stay aligned. 

Code that is used for both problems: 

<div class="control-section">
    <ejs-gantt id="resources" [dataSource]="data" [taskFields]="taskSettings" [treeColumnIndex]="0"
        [splitterSettings]="splitterSettings" [labelSettings]="labelSettings" [editSettings]="editSettings" [enableContextMenu]='true' 
        [rowHeight]='61'  height="450px" [allowSelection]="true" [highlightWeekends]="true"
        [toolbar]="toolbar" [resourceFields]="resourceFields" (rowDataBound)="rowDataBound($event)" (dataBound)="actionComplete($event)"
        [timelineSettings]="timelineSettings" [projectStartDate]='projectStartDate' [projectEndDate]='projectEndDate'
        [resources]="resources" workUnit="Hour">
        <e-columns>
            <e-column field='TaskID' visible='false' width='0'>
                <ng-template #template let-data>
                    <div class="e-treecolumn-container">
                        <span class="e-icons e-none"></span>
                        <span class="e-icons e-none"></span>
                        <span class="e-treecell"></span></div>
                </ng-template>
            </e-column>
            <e-column field='TaskName' headerText='Name' width='180' headerTextAlign='left'>
                <ng-template  #template let-data>                
                    <table style="width:180px;" *ngIf='data.taskData.IsSectionHeader'>
                        <tr>
                            <td>{{data.taskData.Bucket}}</td>
                        </tr>
                    </table>
                    <table style="width:180px;height: 50px" *ngIf='!data.taskData.IsSectionHeader && !data.taskData.BusinessObjectives'>
                        <tr>
                            <td>{{data.taskData.TeamName}}</td>
                        </tr>
                        <tr>
                            <th>{{data.taskData.TaskName}}</th>
                        </tr>
                    </table>
                    <div style="width:100%;height: 50px" *ngIf='!data.taskData.IsSectionHeader && data.taskData.BusinessObjectives'>
                        Great job! You don’t have any unplanned work.
                    </div>
                </ng-template>
            </e-column>
            <e-column field='Details' headerText='Details' width='300' textAlign='center'>
                <ng-template #template let-data>
                    <table style="width:300px;height: 50px;" *ngIf="!data.taskData.IsSectionHeader">
                        <tr>
                            <td style="width: 100px;">Allocated</td>
                            <td style="width: 100px;">Stories</td>
                            <td style="width: 100px;">Points</td>

                        </tr>
                        <tr>
                            <th style="color: red">{{data.taskData.Allocation}}%</th>
                            <th>{{data.taskData.StoriesCurrent}} of {{replaceEmpty(data.taskData.StoriesTotal)}}</th>
                            <th>{{data.taskData.PointCurrent}} of {{replaceEmpty(data.taskData.PointsTotal)}}</th>
                        </tr>
                    </table>
                </ng-template>
            </e-column>
            <e-column field='StartDate' headerText='Start Date' width='120' headerTextAlign='center' textAlign='center'>
                <ng-template #template let-data>
                    <table style="width:80px;height: 50px;" *ngIf="!data.taskData.IsSectionHeader">
                        <tr>
                            <td>
                                {{formatDate(data.taskData.StartDate)}}
                            </td>
                        </tr>
                    </table>
                </ng-template>
            </e-column>
            <e-column field='ReleaseDate' headerText='Anticipated Release Date' width='120' headerTextAlign='center' textAlign='center'>
                <ng-template #template let-data>
                    <table style="width:80px;height: 50px;" *ngIf="!data.taskData.IsSectionHeader">
                        <tr>
                            <td>
                                {{formatDate(data.taskData.ReleaseDate)}}
                            </td>
                        </tr>
                    </table>                    
                </ng-template>
            </e-column>
        </e-columns>
        <ng-template #taskbarTemplate let-data>
            <div class="e-gantt-child-taskbar">
                <div class="template-row">
                    <div class="e-complete" *ngIf="data.taskData.Complete > 0" [ngStyle]="widthdata.taskData.Complete + '%' }">
                        <span class="e-task-label">{{ data.taskData.Complete }}% Complete</span>
                    </div>
    
                    <div class="e-in-progress" *ngIf="data.taskData.InProgress > 0" [ngStyle]="widthdata.taskData.InProgress + '%' }">
                        <span class="e-task-label">{{ data.taskData.InProgress }}% In-Progress</span>
                    </div>
    
                    <div class="e-planned" *ngIf="data.taskData.Planned > 0" [ngStyle]="widthdata.taskData.Planned + '%' }">
                        <span class="e-task-label">{{ data.taskData.Planned }}% Planned</span>
                    </div>
    
                    <div class="e-not-planned" *ngIf="data.taskData.NotPlanned > 0" [ngStyle]="widthdata.taskData.NotPlanned + '%' }">
                        <span class="e-task-label">{{ data.taskData.NotPlanned }}% Not Planned*</span>
                    </div>
              </div>
            </div>
        </ng-template>
    </ejs-gantt>
</div>


2 Replies

AT Andrew Tarr April 23, 2020 08:56 PM UTC

I couldnt paste this into the first message: 
public dataobject[];
    public editSettingsEditSettingsModel;
    public labelSettingsobject;
    public projectEndDateDate;
    public projectStartDateDate;
    public resourceFieldsResourceFieldsModel;
    public resourcesobject[];
    public splitterSettingsobject;
    public taskbarTemplateany;
    public taskSettingsTaskFieldsModel;
    public timelineSettingsobject;
    public toolbarstring[];

    public ngOnInit(): void {
        this.data = resourceData;
        this.taskSettings = {
            id: 'Id',
            name: 'TaskName',
            startDate: 'StartDate',
            endDate: 'ReleaseDate',
            child: 'BusinessObjectives'
        };
        this.resourceFields = {
            id: 'resourceId',
            name: 'resourceName',
            unit: 'unit'
        };
        this.editSettings = {
            allowAdding: true,
            allowEditing: true,
            allowDeleting: true,
            allowTaskbarEditing: true,
            showDeleteConfirmDialog: true,
        };
        this.toolbar = ['Add''Edit''Update''Delete''Cancel''ExpandAll''CollapseAll'];
        this.splitterSettings = {
            columnIndex: 5.1
        };
        this.projectStartDate = new Date('01/28/2020');
        this.projectEndDate = new Date('07/28/2020');

        this.timelineSettings = {
            showTooltip: true,
            timelineUnitSize: 80,
            updateTimescaleView: true,
            weekStartDay: 1//SUNDAY == 0
            weekendBackground: 'red',
            topTier: {
                format: 'MMM yyy',
                unit: 'Month',
                count: 1,
            },
            bottomTier: {
                format: 'MMM dd',
                unit: 'Week',
            }
        };
    }


LG Logeswari Gopalakrishnan Syncfusion Team April 24, 2020 05:20 PM UTC

Hi Andrew, 
 
Issue 1:  
 
We have analyzed the your query, as you were using the templates in Grid side, the TR element’s height will be calculated based on inner contents in Grid part, this may greater than rowHeight property value. 
So please check whether the TR elements height value of both Grid and Chart side are equal to the rowHeight property value using developer tools. If it is greater than rowHeight value set maximum TR height value to rowHeight property. To resolve this issue set the maximum TR element’s height to the rowHeight property of Gantt. 
 
 
Issue 2:   
 
By analyzing the screenshot we note, that you have added header element. We have prepared a sample similar to the screenshot attached by adding tr element using dataBound event. While appending tr element chart container('.e-chart-rows-container')  heightis not same as grid container. This results in the mismatch of grid rows and chart rows, while scrolling. We need to set height of container based on header element’s height. And row misalignment was occurred when we don’t refer the bootstrap CSS file in application. So make sure you are referred bootstrap CSS in your application. 
Please refer the following code snippet to refer the bootstrap file in your application. 
 
 
<link rel='nofollow' href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" /> 
   
 
 
We also prepared a sample for both issues, please find the demo sample from below link. 
 
 
If you are still facing any issues, please modify the shared sample link and revert us. So that it will be very helpful for us to check in our end and provide you a better solution. 
 
Regards, 
Logeswari G 


Loader.
Up arrow icon