Gantt Angular API

Component

GanttComponent

Module

GanttModule

Interface

TableColumnGroup
TableColumn
GanttDataSourceSettings
GanttDataSourceSettingsDataField

Unions

GanttColumnSizeMode

'auto' 'default'

GanttDataSourceSettingsDataFieldDataType

'string' 'date' 'boolean' 'number' 'array' 'any'

GanttDataSourceSettingsDataSourceType

'array' 'json' 'xml' 'csv' 'tsv'

GanttDataSourceSettingsSanitizeHTML

'all' 'blackList' 'none'

GanttSelectionMode

'one' 'many' 'extended'

GanttSortMode

'none' 'one' 'many'

TableColumnDataType

'boolean' 'date' 'number' 'string' 'any'

TableColumnFreeze

'true' 'near' 'far'
{{union}}

GanttComponent

Gantt component allows you to display and edit complex data.

Selector

smart-gantt

Properties

Events

Methods

Inputs

columnGroupsTableColumnGroup[]

Sets or gets a list of column groups that constitute the column header hierarchy. Note: when column header hierarchy is created, column resizing and auto-sizing is not supported.

Try a demo showcasing the columnGroups property.

Example

Set the columnGroups property.

 <smart-gantt [columnGroups]="[{ label: 'User Info', name: 'userInfo' }, { label: 'Product Info', name: 'productInfo' }]"></smart-gantt>

Set the columnGroups property by using the component's instance.

 this.gantt.columnGroups = [{ label: 'User Info', name: 'userInfo' }, { label: 'Product Info', name: 'productInfo', parentGroup: 'purchaseInfo' }, { label: 'Purchase Info', name: 'purchaseInfo' }];

Get the columnGroups property.

 let columnGroups = this.gantt.columnGroups;

columnMinWidthstring | number

Sets or gets the min width of columns when columnSizeMode is 'auto' or when resizing columns. This property has no effect on columns with programmatically set width.

Default value

50px
Try a demo showcasing the columnMinWidth property.

Example

Set the columnMinWidth property.

 <smart-gantt [columnMinWidth]="100"></smart-gantt>

Set the columnMinWidth property by using the component's instance.

 this.gantt.columnMinWidth = 20px;

Get the columnMinWidth property.

 let columnMinWidth = this.gantt.columnMinWidth;

columnReorderboolean

Sets or gets whether the reordering of columns is enabled.

Default value

false
Try a demo showcasing the columnReorder property.

Example

Set the columnReorder property.

 <smart-gantt [columnReorder]="true"></smart-gantt>

Set the columnReorder property by using the component's instance.

 this.gantt.columnReorder = false;

Get the columnReorder property.

 let columnReorder = this.gantt.columnReorder;

columnResizeboolean

Sets or gets whether the resizing of columns is enabled. Note: column sizes continue to adhere to the behavior of the standard HTML table element's table-layout: fixed, upon which smart-table is based.

Default value

false
Try a demo showcasing the columnResize property.

Example

Set the columnResize property.

 <smart-gantt [columnResize]="true"></smart-gantt>

Set the columnResize property by using the component's instance.

 this.gantt.columnResize = false;

Get the columnResize property.

 let columnResize = this.gantt.columnResize;

columnResizeFeedbackboolean

Sets or gets whether when resizing a column, a feedback showing the new column width in px will be displayed.

Default value

false
Try a demo showcasing the columnResizeFeedback property.

Example

Set the columnResizeFeedback property.

 <smart-gantt [columnResizeFeedback]="true"></smart-gantt>

Set the columnResizeFeedback property by using the component's instance.

 this.gantt.columnResizeFeedback = false;

Get the columnResizeFeedback property.

 let columnResizeFeedback = this.gantt.columnResizeFeedback;

columnsTableColumn[]

Describes the columns properties.

Try a demo showcasing the columns property.

Example

Set the columns property.

 <smart-gantt [columns]="[{ label: 'In progress', dataField: 'inProgress' }, { label: 'Testing', dataField: 'testing' }, { label: 'Done', dataField: 'done' }]"></smart-gantt>

Set the columns property by using the component's instance.

 this.gantt.columns = [{ label: 'In progress', dataField: 'inProgress' }, { label: 'Testing', dataField: 'testing', orientation: 'horizontal', columns: [{ label: 'Manual testing', dataField: 'manualTesting', selected: true, columns: [{ label: 'Desktop devices', dataField: 'desktop' }, { label: 'Mobile devices', dataField: 'mobile', selected: true }] }, { label: 'Unit testing', dataField: 'unitTesting' }] }];

Get the columns property.

 let columns = this.gantt.columns;

columnSizeModeGanttColumnSizeMode

Sets or gets the column sizing behavior. In 'auto' mode Columns are automatically sized based on their content and the value of the columnMinWidth property, unless there is not enough space in the Table, in which case ellipses are shown. User-set static column width is still respected. In 'default' mode Columns are sized according to the rules of the standard HTML table element's table-layout: fixed. Custom width can also be applied to columns in this case by setting the column width property.

Default value

"default"
Try a demo showcasing the columnSizeMode property.

Example

Set the columnSizeMode property.

 <smart-gantt [columnSizeMode]="'auto'"></smart-gantt>

Set the columnSizeMode property by using the component's instance.

 this.gantt.columnSizeMode = 'default';

Get the columnSizeMode property.

 let columnSizeMode = this.gantt.columnSizeMode;

dataRowIdstring

When binding the dataSource property directly to an array (as opposed to an instance of Smart.DataAdapter), sets or gets the name of the data field in the source array to bind row ids to.

Default value

"null"

Example

Set the dataRowId property.

 <smart-gantt [dataRowId]="'ID'"></smart-gantt>

Set the dataRowId property by using the component's instance.

 this.gantt.dataRowId = 'uid';

Get the dataRowId property.

 let dataRowId = this.gantt.dataRowId;

dataSourceany

Determines the data source of the table component. The data source of the Table can be a regular Array or a DataAdapter instance. You can read more about the dataAdapter here - https://www.htmlelements.com/docs/data-adapter/.

Default value

""
Try a demo showcasing the dataSource property.

dataSourceSettingsGanttDataSourceSettings

Sets the grid's data source settings when the dataSource property is set to an Array or URL.

Try a demo showcasing the dataSourceSettings property.

dataTransformany

A callback function that can be used to transform the initial dataSource records. If implemented, it is called once for each record (which is passed as an argument).

Example

Set the dataTransform property.

 <smart-gantt [dataTransform]="dataTransformCallback"></smart-gantt>

Set the dataTransform property by using the component's instance.

 this.gantt.dataTransform = dataTransform;

Get the dataTransform property.

 let dataTransform = this.gantt.dataTransform;

disabledboolean

Disables the interaction with the element.

Default value

false

Example

Set the disabled property.

 <smart-gantt [disabled]="true"></smart-gantt>

Set the disabled property by using the component's instance.

 this.gantt.disabled = false;

Get the disabled property.

 let disabled = this.gantt.disabled;

filteringboolean

Sets or gets whether the Table can be filtered. By default, the Table can be filtered by all string and numeric columns through a filter input in the header.

Default value

false
Try a demo showcasing the filtering property.

Example

Set the filtering property.

 <smart-gantt [filtering]="true"></smart-gantt>

Set the filtering property by using the component's instance.

 this.gantt.filtering = false;

Get the filtering property.

 let filtering = this.gantt.filtering;

filterRowboolean

Sets or gets whether the Table can be filtered via a filter row.

Default value

false
Try a demo showcasing the filterRow property.

Example

Set the filterRow property.

 <smart-gantt [filterRow]="true"></smart-gantt>

Set the filterRow property by using the component's instance.

 this.gantt.filterRow = false;

Get the filterRow property.

 let filterRow = this.gantt.filterRow;

filterTemplatestring

Sets or gets the id of an HTML template element to be applied as a custom filter template.

Default value

"null"
Try a demo showcasing the filterTemplate property.

Example

Set the filterTemplate property.

 <smart-gantt [filterTemplate]="'customFilterTemplate'"></smart-gantt>

Set the filterTemplate property by using the component's instance.

 this.gantt.filterTemplate = 'myFilterTemplate';

Get the filterTemplate property.

 let filterTemplate = this.gantt.filterTemplate;

footerRowstring

Sets or gets the id of an HTML template element to be applied as footer row(s).

Default value

"null"
Try a demo showcasing the footerRow property.

Example

Set the footerRow property.

 <smart-gantt [footerRow]="'customFooterRow'"></smart-gantt>

Set the footerRow property by using the component's instance.

 this.gantt.footerRow = 'myFooterRow';

Get the footerRow property.

 let footerRow = this.gantt.footerRow;

freezeFooterboolean

Sets or gets whether the Table's footer is sticky/frozen.

Default value

false
Try a demo showcasing the freezeFooter property.

Example

Set the freezeFooter property.

 <smart-gantt [freezeFooter]="true"></smart-gantt>

Set the freezeFooter property by using the component's instance.

 this.gantt.freezeFooter = false;

Get the freezeFooter property.

 let freezeFooter = this.gantt.freezeFooter;

freezeHeaderboolean

Sets or gets whether the Table's column header is sticky/frozen.

Default value

false
Try a demo showcasing the freezeHeader property.

Example

Set the freezeHeader property.

 <smart-gantt [freezeHeader]="true"></smart-gantt>

Set the freezeHeader property by using the component's instance.

 this.gantt.freezeHeader = false;

Get the freezeHeader property.

 let freezeHeader = this.gantt.freezeHeader;

headerRowstring

Sets or gets the id of an HTML template element to be applied as additional column header(s).

Default value

"null"
Try a demo showcasing the headerRow property.

Example

Set the headerRow property.

 <smart-gantt [headerRow]="'customHeaderRowTemplate'"></smart-gantt>

Set the headerRow property by using the component's instance.

 this.gantt.headerRow = 'myHeaderRow';

Get the headerRow property.

 let headerRow = this.gantt.headerRow;

keyboardNavigationboolean

Sets or gets whether navigation with the keyboard is enabled in the Table.

Default value

false
Try a demo showcasing the keyboardNavigation property.

Example

Set the keyboardNavigation property.

 <smart-gantt [keyboardNavigation]="true"></smart-gantt>

Set the keyboardNavigation property by using the component's instance.

 this.gantt.keyboardNavigation = false;

Get the keyboardNavigation property.

 let keyboardNavigation = this.gantt.keyboardNavigation;

localestring

Sets or gets the language. Used in conjunction with the property messages.

Default value

"en"
Try a demo showcasing the locale property.

Example

Set the locale property.

 <smart-gantt [locale]="'de'"></smart-gantt>

Set the locale property by using the component's instance.

 this.gantt.locale = 'fr';

Get the locale property.

 let locale = this.gantt.locale;

messagesany

Sets or gets an object specifying strings used in the element that can be localized. Used in conjunction with the property locale.

Default value




"en": {

"add": "Add condition",

"all": "All columns",

"apply": "Apply",

"between": "Between",

"cancel": "Cancel",

"clearFilter": "Clear filter",

"close": "Close",

"column": "Column:",

"condition": "Condition:",

"conditionalFormatting": "Conditional Formatting",

"CONTAINS": "contains",

"CONTAINS_CASE_SENSITIVE": "contains (case sensitive)",

"DOES_NOT_CONTAIN": "does not contain",

"DOES_NOT_CONTAIN_CASE_SENSITIVE": "does not contain (case sensitive)",

"EMPTY": "empty",

"ENDS_WITH": "ends with",

"ENDS_WITH_CASE_SENSITIVE": "ends with (case sensitive)",

"EQUAL": "equal",

"EQUAL_CASE_SENSITIVE": "equal (case sensitive)",

"filterCondition": "Filter condition",

"filterPlaceholder": "Filter",

"firstButton": "First",

"fontFamily": "Font family:",

"fontSize": "Font size:",

"format": "Format:",

"formatColumn": "Format Column",

"GREATER_THAN": "greater than",

"GREATER_THAN_OR_EQUAL": "greater than or equal",

"greaterThan": "Greater Than",

"highlight": "Highlight",

"invalidValue": "Invalid value",

"itemsPerPage": "Items per page:",

"lastButton": "Last",

"LESS_THAN": "less than",

"LESS_THAN_OR_EQUAL": "less than or equal",

"lessThan": "Less Than",

"nextButton": "Next",

"NOT_EMPTY": "not empty",

"NOT_EQUAL": "not equal",

"NOT_NULL": "not null",

"notEqual": "Not Equal To",

"NULL": "null",

"ok": "OK",

"previousButton": "Previous",

"remove": "Remove condition",

"secondValue": "Second value:",

"STARTS_WITH": "starts with",

"STARTS_WITH_CASE_SENSITIVE": "starts with (case sensitive)",

"summaryPrefix": "of",

"text": "Text",

"value": "Value:",

"with": "with"

}

Try a demo showcasing the messages property.

Example

Set the messages property.

 <smart-gantt [messages]="{"he":{"add":"הוסף תנאי","all":"כל העמודות","apply":"להגיש מועמדות","between":"בֵּין","cancel":"לְבַטֵל","clearFilter":"נקה את המסנן","close":"סגור","column":"טור:","condition":"מַצָב:","conditionalFormatting":"עיצוב מותנה","CONTAINS":"מכיל","CONTAINS_CASE_SENSITIVE":"מכיל (רגיש רישיות)","DOES_NOT_CONTAIN":"לא מכיל","DOES_NOT_CONTAIN_CASE_SENSITIVE":"לא מכיל (רגיש רישיות)","EMPTY":"ריק","ENDS_WITH":"נגמר עם","ENDS_WITH_CASE_SENSITIVE":"מסתיים ב (רגיש רישיות)","EQUAL":"שווה","EQUAL_CASE_SENSITIVE":"שווה (רגיש לרישיות","filterCondition":"מצב סינון","filterPlaceholder":"לְסַנֵן","firstButton":"ראשון","fontFamily":"משפחת גופן:","fontSize":"גודל גופן:","format":"פוּרמָט:","formatColumn":"עמוד עמוד","GREATER_THAN":"גדול מ","GREATER_THAN_OR_EQUAL":"גדול או שווה","greaterThan":"גדול מ","highlight":"שִׂיא","invalidValue":"ערך לא תקין","itemsPerPage":"פריטים לעמוד:","lastButton":"אחרון","LESS_THAN":"פחות מ","LESS_THAN_OR_EQUAL":"פחות מ או שווה","lessThan":"פחות מ","nextButton":"הַבָּא","NOT_EMPTY":"לא ריק","NOT_EQUAL":"לא שווה","NOT_NULL":"לא ריק","notEqual":"לא שווה ל","NULL":"null","ok":"בסדר","previousButton":"קודם","remove":"הסר את המצב","secondValue":"ערך שני:","STARTS_WITH":"מתחיל עם","STARTS_WITH_CASE_SENSITIVE":"מתחיל עם (רגיש רישיות)","summaryPrefix":"שֶׁל","text":"טֶקסט","value":"ערך:","with":"עם"}}"></smart-gantt>

Set the messages property by using the component's instance.

 this.gantt.messages = {"en":{"add":"Add condition","all":"All columns","apply":"Apply","between":"Between","cancel":"Cancel","clearFilter":"Clear filter","close":"Close","column":"Column:","condition":"Condition:","conditionalFormatting":"Conditional Formatting","CONTAINS":"contains","CONTAINS_CASE_SENSITIVE":"contains (case sensitive)","DOES_NOT_CONTAIN":"does not contain","DOES_NOT_CONTAIN_CASE_SENSITIVE":"does not contain (case sensitive)","EMPTY":"empty","ENDS_WITH":"ends with","ENDS_WITH_CASE_SENSITIVE":"ends with (case sensitive)","EQUAL":"equal","EQUAL_CASE_SENSITIVE":"equal (case sensitive)","filterCondition":"Filter condition","filterPlaceholder":"Filter","firstButton":"First","fontFamily":"Font family:","fontSize":"Font size:","format":"Format:","formatColumn":"Format Column","GREATER_THAN":"greater than","GREATER_THAN_OR_EQUAL":"greater than or equal","greaterThan":"Greater Than","highlight":"Highlight","invalidValue":"Invalid value","itemsPerPage":"Items per page:","lastButton":"Last","LESS_THAN":"less than","LESS_THAN_OR_EQUAL":"less than or equal","lessThan":"Less Than","nextButton":"Next","NOT_EMPTY":"not empty","NOT_EQUAL":"not equal","NOT_NULL":"not null","notEqual":"Not Equal To","NULL":"null","ok":"OK","previousButton":"Previous","remove":"Remove condition","secondValue":"Second value:","STARTS_WITH":"starts with","STARTS_WITH_CASE_SENSITIVE":"starts with (case sensitive)","summaryPrefix":"of","text":"Text","value":"Value:","with":"with"}};

Get the messages property.

 let messages = this.gantt.messages;

onCellRenderany

A callback function executed each time a Table cell is rendered.

Example

Set the onCellRender property.

 <smart-gantt [onCellRender]="onCellRender"></smart-gantt>

Set the onCellRender property by using the component's instance.

 this.gantt.onCellRender = onCellRenderCallback;

Get the onCellRender property.

 let onCellRender = this.gantt.onCellRender;

onColumnRender{ (dataField: string, headerCell: HTMLTableCellElement): void }

A callback function executed each time a Table column header cell is rendered.

Example

Set the onColumnRender property.

 <smart-gantt [onColumnRender]="onColumnRender"></smart-gantt>

Set the onColumnRender property by using the component's instance.

 this.gantt.onColumnRender = onColumnRenderCallback;

Get the onColumnRender property.

 let onColumnRender = this.gantt.onColumnRender;

onInit{ (): void }

A callback function executed when the Table is being initialized.

Example

Set the onInit property.

 <smart-gantt [onInit]="onInit"></smart-gantt>

Set the onInit property by using the component's instance.

 this.gantt.onInit = onInitCallback;

Get the onInit property.

 let onInit = this.gantt.onInit;

rightToLeftboolean

Sets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts.

Default value

false
Try a demo showcasing the rightToLeft property.

Example

Set the rightToLeft property.

 <smart-gantt [rightToLeft]="true"></smart-gantt>

Set the rightToLeft property by using the component's instance.

 this.gantt.rightToLeft = true;

Get the rightToLeft property.

 let rightToLeft = this.gantt.rightToLeft;

rowDetailTemplatestring

Sets or gets a string template to be applied as row detail template. Each cell value in the master row can be placed in the detail row by specifying the cell's data field in double curly brackets (e.g. {{price}}. The details can then be displayed by expanding the row by clicking it.

Default value

"null"
Try a demo showcasing the rowDetailTemplate property.

Example

Set the rowDetailTemplate property.

 <smart-gantt [rowDetailTemplate]="'
{{number}}
'"></smart-gantt>

Set the rowDetailTemplate property by using the component's instance.

 this.gantt.rowDetailTemplate = '
{{name}}
';

Get the rowDetailTemplate property.

 let rowDetailTemplate = this.gantt.rowDetailTemplate;

selectedany[]

Sets or gets an array of the Table's selected row's ids.

Example

Set the selected property.

 <smart-gantt [selected]="[5, 8, 9]"></smart-gantt>

Set the selected property by using the component's instance.

 this.gantt.selected = [0];

Get the selected property.

 let selected = this.gantt.selected;

selectionboolean

Sets or gets whether row selection (via checkboxes) is enabled.

Default value

false
Try a demo showcasing the selection property.

Example

Set the selection property.

 <smart-gantt [selection]="true"></smart-gantt>

Set the selection property by using the component's instance.

 this.gantt.selection = false;

Get the selection property.

 let selection = this.gantt.selection;

selectionModeGanttSelectionMode

Sets or gets the selection mode. Only applicable when selection is enabled.

Default value

"many"
Try a demo showcasing the selectionMode property.

Example

Set the selectionMode property.

 <smart-gantt [selectionMode]="'extended'"></smart-gantt>

Set the selectionMode property by using the component's instance.

 this.gantt.selectionMode = 'many';

Get the selectionMode property.

 let selectionMode = this.gantt.selectionMode;

sortany

A callback function executed when a column is sorted that can be used to override the default sorting behavior. The function is passed four parameters:

  1. dataSource - the Table's data source
  2. sortColumns - an array of the data fields of columns to be sorted by
  3. directions - an array of sort directions to be sorted by (corresponding to sortColumns)
  4. defaultCompareFunctions - an array of default compare functions to be sorted by (corresponding to sortColumns), useful if the sorting of some columns does not have to be overridden

Try a demo showcasing the sort property.

Example

Set the sort property.

 <smart-gantt [sort]="sort"></smart-gantt>

Set the sort property by using the component's instance.

 this.gantt.sort = sortCallback;

Get the sort property.

 let sort = this.gantt.sort;

sortModeGanttSortMode

Determines the sorting mode of the Table.

Default value

"none"
Try a demo showcasing the sortMode property.

Example

Set the sortMode property.

 <smart-gantt [sortMode]="'one'"></smart-gantt>

Set the sortMode property by using the component's instance.

 this.gantt.sortMode = 'many';

Get the sortMode property.

 let sortMode = this.gantt.sortMode;

tooltipboolean

Sets or gets whether when hovering a cell with truncated content, a tooltip with the full content will be shown.

Default value

false
Try a demo showcasing the tooltip property.

Example

Set the tooltip property.

 <smart-gantt [tooltip]="true"></smart-gantt>

Set the tooltip property by using the component's instance.

 this.gantt.tooltip = false;

Get the tooltip property.

 let tooltip = this.gantt.tooltip;

Events

cellBeginEditEventEmitter<CustomEvent>

This event is triggered when a cell edit operation has been initiated.

Arguments

$eventCustomEvent
$event.detailObject
$event.detail.id - The id of the row.
$event.detail.dataField - The data field of the cell's column.
$event.detail.row - The data of the cell's row.
$event.detail.value - The data value of the cell.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of cellBeginEdit event.


Html

 <smart-gantt (cellBeginEdit)="onCellBeginEdit($event)"></smart-gantt>

Typescript

onCellBeginEdit($event) {
    const detail = event.detail,
        id = detail.id,
        dataField = detail.dataField,
        row = detail.row,
        value = detail.value;


	// event handling code goes here.
}


Subscribe to event by using the 'addEventListener' method:
this.gantt.addEventListener('cellBeginEdit', (event: CustomEvent) => {
    const detail = event.detail,
        id = detail.id,
        dataField = detail.dataField,
        row = detail.row,
        value = detail.value;

	// event handling code goes here.
})

cellClickEventEmitter<CustomEvent>

This event is triggered when a cell has been clicked.

Arguments

$eventCustomEvent
$event.detailObject
$event.detail.id - The cell's row id.
$event.detail.dataField - The data field of the cell's column.
$event.detail.row - The data of the cell's row.
$event.detail.value - The data value of the cell.
$event.detail.originalEvent - The 'click' event object.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of cellClick event.


Html

 <smart-gantt (cellClick)="onCellClick($event)"></smart-gantt>

Typescript

onCellClick($event) {
    const detail = event.detail,
        id = detail.id,
        dataField = detail.dataField,
        row = detail.row,
        value = detail.value,
        originalEvent = detail.originalEvent;


	// event handling code goes here.
}


Subscribe to event by using the 'addEventListener' method:
this.gantt.addEventListener('cellClick', (event: CustomEvent) => {
    const detail = event.detail,
        id = detail.id,
        dataField = detail.dataField,
        row = detail.row,
        value = detail.value,
        originalEvent = detail.originalEvent;

	// event handling code goes here.
})

cellEndEditEventEmitter<CustomEvent>

This event is triggered when a cell has been edited.

Arguments

$eventCustomEvent
$event.detailObject
$event.detail.id - The id of the row.
$event.detail.dataField - The data field of the cell's column.
$event.detail.row - The new data of the cell's row.
$event.detail.value - The data value of the cell.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of cellEndEdit event.


Html

 <smart-gantt (cellEndEdit)="onCellEndEdit($event)"></smart-gantt>

Typescript

onCellEndEdit($event) {
    const detail = event.detail,
        id = detail.id,
        dataField = detail.dataField,
        row = detail.row,
        value = detail.value;


	// event handling code goes here.
}


Subscribe to event by using the 'addEventListener' method:
this.gantt.addEventListener('cellEndEdit', (event: CustomEvent) => {
    const detail = event.detail,
        id = detail.id,
        dataField = detail.dataField,
        row = detail.row,
        value = detail.value;

	// event handling code goes here.
})

changeEventEmitter<CustomEvent>

This event is triggered when the selection is changed. Within the event handler you can get the selection by using the 'getSelection' method.

Arguments

$eventCustomEvent
$event.detailObject
$event.detail.type - The type of action that initiated the selection change. Possible types: 'programmatic', 'interaction', 'remove'.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of change event.


Html

 <smart-gantt (change)="onChange($event)"></smart-gantt>

Typescript

onChange($event) {
    const detail = event.detail,
        type = detail.type;


	// event handling code goes here.
}


Subscribe to event by using the 'addEventListener' method:
this.gantt.addEventListener('change', (event: CustomEvent) => {
    const detail = event.detail,
        type = detail.type;

	// event handling code goes here.
})

collapseEventEmitter<CustomEvent>

This event is triggered when a row has been collapsed.

Arguments

$eventCustomEvent
$event.detailObject
$event.detail.id - The id of the collapsed row.
$event.detail.record - The data of the collapsed row.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of collapse event.


Html

 <smart-gantt (collapse)="onCollapse($event)"></smart-gantt>

Typescript

onCollapse($event) {
    const detail = event.detail,
        id = detail.id,
        record = detail.record;


	// event handling code goes here.
}


Subscribe to event by using the 'addEventListener' method:
this.gantt.addEventListener('collapse', (event: CustomEvent) => {
    const detail = event.detail,
        id = detail.id,
        record = detail.record;

	// event handling code goes here.
})

expandEventEmitter<CustomEvent>

This event is triggered when a row has been expanded.

Arguments

$eventCustomEvent
$event.detailObject
$event.detail.id - The id of the expanded row.
$event.detail.record - The (aggregated) data of the expanded row.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of expand event.


Html

 <smart-gantt (expand)="onExpand($event)"></smart-gantt>

Typescript

onExpand($event) {
    const detail = event.detail,
        id = detail.id,
        record = detail.record;


	// event handling code goes here.
}


Subscribe to event by using the 'addEventListener' method:
this.gantt.addEventListener('expand', (event: CustomEvent) => {
    const detail = event.detail,
        id = detail.id,
        record = detail.record;

	// event handling code goes here.
})

columnClickEventEmitter<CustomEvent>

This event is triggered when a column header cell has been clicked.

Arguments

$eventCustomEvent
$event.detailObject
$event.detail.dataField - The data field of the cell's column.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of columnClick event.


Html

 <smart-gantt (columnClick)="onColumnClick($event)"></smart-gantt>

Typescript

onColumnClick($event) {
    const detail = event.detail,
        dataField = detail.dataField;


	// event handling code goes here.
}


Subscribe to event by using the 'addEventListener' method:
this.gantt.addEventListener('columnClick', (event: CustomEvent) => {
    const detail = event.detail,
        dataField = detail.dataField;

	// event handling code goes here.
})

columnResizeEventEmitter<CustomEvent>

This event is triggered when a column has been resized via dragging or double-click.

Arguments

$eventCustomEvent
$event.detailObject
$event.detail.dataField - The data field of the column.
$event.detail.headerCellElement - The column's header cell HTML element.
$event.detail.width - The new width of the column.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of columnResize event.


Html

 <smart-gantt (columnResize)="onColumnResize($event)"></smart-gantt>

Typescript

onColumnResize($event) {
    const detail = event.detail,
        dataField = detail.dataField,
        headerCellElement = detail.headerCellElement,
        width = detail.width;


	// event handling code goes here.
}


Subscribe to event by using the 'addEventListener' method:
this.gantt.addEventListener('columnResize', (event: CustomEvent) => {
    const detail = event.detail,
        dataField = detail.dataField,
        headerCellElement = detail.headerCellElement,
        width = detail.width;

	// event handling code goes here.
})

filterEventEmitter<CustomEvent>

This event is triggered when a filtering-related action is made.

Arguments

$eventCustomEvent
$event.detailObject
$event.detail.action - The filtering action. Possible actions: 'add', 'remove'.
$event.detail.filters - The added filters. Only when action is 'add'.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of filter event.


Html

 <smart-gantt (filter)="onFilter($event)"></smart-gantt>

Typescript

onFilter($event) {
    const detail = event.detail,
        action = detail.action,
        filters = detail.filters;


	// event handling code goes here.
}


Subscribe to event by using the 'addEventListener' method:
this.gantt.addEventListener('filter', (event: CustomEvent) => {
    const detail = event.detail,
        action = detail.action,
        filters = detail.filters;

	// event handling code goes here.
})

groupEventEmitter<CustomEvent>

This event is triggered when a grouping-related action is made.

Arguments

$eventCustomEvent
$event.detailObject
$event.detail.action - The grouping action. Possible actions: 'add', 'collapse', 'expand', 'remove'.
$event.detail.dataField - The data field of the column whose grouping is modified.
$event.detail.label - The label of the group (only when collapsing/expanding).
$event.detail.path - The group's path (only when collapsing/expanding). The path includes the path to the expanded/collapsed group starting from the root group. The indexes are joined with '.'. This parameter is available when the 'action' is 'expand' or 'collapse'.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of group event.


Html

 <smart-gantt (group)="onGroup($event)"></smart-gantt>

Typescript

onGroup($event) {
    const detail = event.detail,
        action = detail.action,
        dataField = detail.dataField,
        label = detail.label,
        path = detail.path;


	// event handling code goes here.
}


Subscribe to event by using the 'addEventListener' method:
this.gantt.addEventListener('group', (event: CustomEvent) => {
    const detail = event.detail,
        action = detail.action,
        dataField = detail.dataField,
        label = detail.label,
        path = detail.path;

	// event handling code goes here.
})

rowBeginEditEventEmitter<CustomEvent>

This event is triggered when a row edit operation has been initiated (only when editMode is 'row').

Arguments

$eventCustomEvent
$event.detailObject
$event.detail.id - The id of the row.
$event.detail.row - The data of the row.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of rowBeginEdit event.


Html

 <smart-gantt (rowBeginEdit)="onRowBeginEdit($event)"></smart-gantt>

Typescript

onRowBeginEdit($event) {
    const detail = event.detail,
        id = detail.id,
        row = detail.row;


	// event handling code goes here.
}


Subscribe to event by using the 'addEventListener' method:
this.gantt.addEventListener('rowBeginEdit', (event: CustomEvent) => {
    const detail = event.detail,
        id = detail.id,
        row = detail.row;

	// event handling code goes here.
})

rowEndEditEventEmitter<CustomEvent>

This event is triggered when a row has been edited (only when editMode is 'row').

Arguments

$eventCustomEvent
$event.detailObject
$event.detail.id - The id of the row.
$event.detail.row - The new data of the row.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of rowEndEdit event.


Html

 <smart-gantt (rowEndEdit)="onRowEndEdit($event)"></smart-gantt>

Typescript

onRowEndEdit($event) {
    const detail = event.detail,
        id = detail.id,
        row = detail.row;


	// event handling code goes here.
}


Subscribe to event by using the 'addEventListener' method:
this.gantt.addEventListener('rowEndEdit', (event: CustomEvent) => {
    const detail = event.detail,
        id = detail.id,
        row = detail.row;

	// event handling code goes here.
})

sortEventEmitter<CustomEvent>

This event is triggered when a column header cell has been clicked or sorting is applied programmatically using the Table API.

Arguments

$eventCustomEvent
$event.detailObject
$event.detail.columns - An array with information about the columns the Table has been sorted by.
$event.detail.sortDataFields - An array with information about the data fields the Table has been sorted by.
$event.detail.sortOrders - An array with information about the columns sort orders the Table has been sorted by.
$event.detail.sortDataTypes - An array with information about the columns data types the Table has been sorted by.
$event.detail.type - The type of action that initiated the data sort. Possible types: 'programmatic', 'interaction'

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of sort event.


Html

 <smart-gantt (sort)="onSort($event)"></smart-gantt>

Typescript

onSort($event) {
    const detail = event.detail,
        columns = detail.columns,
        sortDataFields = detail.sortDataFields,
        sortOrders = detail.sortOrders,
        sortDataTypes = detail.sortDataTypes,
        type = detail.type;


	// event handling code goes here.
}


Subscribe to event by using the 'addEventListener' method:
this.gantt.addEventListener('sort', (event: CustomEvent) => {
    const detail = event.detail,
        columns = detail.columns,
        sortDataFields = detail.sortDataFields,
        sortOrders = detail.sortOrders,
        sortDataTypes = detail.sortDataTypes,
        type = detail.type;

	// event handling code goes here.
})

ticketDragStartEventEmitter<CustomEvent>

This event is triggered when a ticket drag starts.

Arguments

$eventCustomEvent
$event.detailObject
$event.detail.data - An object with ticket's data.
$event.detail.id - The row's id.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of ticketDragStart event.


Html

 <smart-gantt (ticketDragStart)="onTicketDragStart($event)"></smart-gantt>

Typescript

onTicketDragStart($event) {
    const detail = event.detail,
        data = detail.data,
        id = detail.id;


	// event handling code goes here.
}


Subscribe to event by using the 'addEventListener' method:
this.gantt.addEventListener('ticketDragStart', (event: CustomEvent) => {
    const detail = event.detail,
        data = detail.data,
        id = detail.id;

	// event handling code goes here.
})

ticketDragCancelEventEmitter<CustomEvent>

This event is triggered when a ticket drag is canceled. This can happen when the user presses the 'Escape' key.

Arguments

$eventCustomEvent
$event.detailObject
$event.detail.data - An object with ticket's data.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of ticketDragCancel event.


Html

 <smart-gantt (ticketDragCancel)="onTicketDragCancel($event)"></smart-gantt>

Typescript

onTicketDragCancel($event) {
    const detail = event.detail,
        data = detail.data;


	// event handling code goes here.
}


Subscribe to event by using the 'addEventListener' method:
this.gantt.addEventListener('ticketDragCancel', (event: CustomEvent) => {
    const detail = event.detail,
        data = detail.data;

	// event handling code goes here.
})

ticketDragEndEventEmitter<CustomEvent>

This event is triggered when a ticket drag ends.

Arguments

$eventCustomEvent
$event.detailObject
$event.detail.data - An object with ticket's data.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of ticketDragEnd event.


Html

 <smart-gantt (ticketDragEnd)="onTicketDragEnd($event)"></smart-gantt>

Typescript

onTicketDragEnd($event) {
    const detail = event.detail,
        data = detail.data;


	// event handling code goes here.
}


Subscribe to event by using the 'addEventListener' method:
this.gantt.addEventListener('ticketDragEnd', (event: CustomEvent) => {
    const detail = event.detail,
        data = detail.data;

	// event handling code goes here.
})

ticketReorderEventEmitter<CustomEvent>

This event is triggered when a ticket is reordered.

Arguments

$eventCustomEvent
$event.detailObject
$event.detail.data - An object with ticket's data.
$event.detail.endData - An object with ticket's data where the end user dropped the dragged ticket.
$event.detail.id - The row's id.

Methods

isDefaultPrevented

Returns true if the event was prevented by any of its subscribers.

Returns

boolean true if the default action was prevented. Otherwise, returns false.

preventDefault

The preventDefault() method prevents the default action for a specified event. In this way, the source component suppresses the built-in behavior that follows the event.

stopPropagation

The stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.

Example

Set up the event handler of ticketReorder event.


Html

 <smart-gantt (ticketReorder)="onTicketReorder($event)"></smart-gantt>

Typescript

onTicketReorder($event) {
    const detail = event.detail,
        data = detail.data,
        endData = detail.endData,
        id = detail.id;


	// event handling code goes here.
}


Subscribe to event by using the 'addEventListener' method:
this.gantt.addEventListener('ticketReorder', (event: CustomEvent) => {
    const detail = event.detail,
        data = detail.data,
        endData = detail.endData,
        id = detail.id;

	// event handling code goes here.
})

Methods

addRow( data: any): void

Adds a new row. When you invoke the method, pass a JSON object with the row's data.

Arguments

dataany

JSON object with the new row's data. Sample JSON: {firstName: 'Peter', lastName: 'Fuller'}.


Invoke the addRow method.

this.gantt.addRow({"firstName":"Peter","lastName":"Fuller"});

addFilter( dataField: string, filter: any): void

Adds a filter to a specific column.

Arguments

dataFieldstring

The column's data field.

filterany

FilterGroup object.


Invoke the addFilter method.

this.gantt.addFilter("'firstName', filterGroup");

beginEdit( row: string | number, dataField?: string): void

Begins an edit operation.

Arguments

rowstring | number

The id of the row to edit.

dataField?string

The dataField of the cell's column. May be omitted when editMode is 'row'.


Invoke the beginEdit method.

this.gantt.beginEdit("3, 'lastName'");

beginUpdate(): void

Begins an update operation. Suspends all table refreshes and renders.


Invoke the beginUpdate method.

this.gantt.beginUpdate();

cancelEdit(): void

Ends the current edit operation and discards changes.


Invoke the cancelEdit method.

this.gantt.cancelEdit();

clearFilters(): void

Clears applied filters.


Invoke the clearFilters method.

this.gantt.clearFilters();

clearSelection(): void

Clears selection.


Invoke the clearSelection method.

this.gantt.clearSelection();

clearSort(): void

Clears the Table sorting.


Invoke the clearSort method.

this.gantt.clearSort();

collapseAllRowDetails(): void

Collapses all row details. Rows that have details defined via the rowDetailTemplate will be collapsed.


Invoke the collapseAllRowDetails method.

this.gantt.collapseAllRowDetails();

disableSelect( rowId: string | number | (string | number)[]): void

Disables a selection of a row. When the 'selection' property is set to 'true', selection is enabled for all rows by default.

Arguments

rowIdstring | number | (string | number)[]

The id of the row (or an array of row ids) to select.


Invoke the disableSelect method.

this.gantt.disableSelect(2);

enableSelect( rowId: string | number | (string | number)[]): void

Enables a selection of a row, if it was previously disabled through a 'disableSelect' method call. When the 'selection' property is set to 'true', selection is enabled for all rows by default.

Arguments

rowIdstring | number | (string | number)[]

The id of the row (or an array of row ids) to select.


Invoke the enableSelect method.

this.gantt.enableSelect(2);

endEdit(): void

Ends the current edit operation and saves changes.


Invoke the endEdit method.

this.gantt.endEdit();

endUpdate( refresh?: boolean): void

Ends an update operation. Resumes all table refreshes and renders. Re-renders the Table.

Arguments

refresh?boolean

Optionally you can pass 'false' in case you need to manually call the 'refresh' method. By default, the table is re-rendered.


Invoke the endUpdate method.

this.gantt.endUpdate();

expandAllRowDetails(): void

Expands all row details. Rows that have details defined via rowDetailTemplate will be expanded.


Invoke the expandAllRowDetails method.

this.gantt.expandAllRowDetails();

getSelection(): void

Returns an array of selected row ids.


Invoke the getSelection method.

const result = this.gantt.getSelection();

getValue( row: string | number, dataField: string): void

Returns the value of a cell.

Arguments

rowstring | number

The id of the cell's row.

dataFieldstring

The dataField of the cell's column.


Invoke the getValue method.

const result = this.gantt.getValue("3, 'lastName'");

getColumnProperty( columnDataField: string, propertyName: string): void

Gets a column property.

Arguments

columnDataFieldstring

Column field name.

propertyNamestring

Column property name.


Invoke the getColumnProperty method.

const result = this.gantt.getColumnProperty("firstName","width");

refresh(): void

Refreshes the table.


Invoke the refresh method.

this.gantt.refresh();

removeFilter( dataField: string): void

Removes filters applied to a specific column.

Arguments

dataFieldstring

The column's data field.


Invoke the removeFilter method.

this.gantt.removeFilter();

removeRow( row: string | number): void

Removes a row by its id.

Arguments

rowstring | number

The id of the cell's row.


Invoke the removeRow method.

this.gantt.removeRow(1);

select( rowId: string | number | (string | number)[]): void

Selects one or more rows.

Arguments

rowIdstring | number | (string | number)[]

The id of the row (or an array of row ids) to select.


Invoke the select method.

this.gantt.select(2);

setValue( row: string | number, dataField: string, value: any): void

Sets the value of a cell.

Arguments

rowstring | number

The id of the cell's row.

dataFieldstring

The dataField of the cell's column.

valueany

The new value of the cell.


Invoke the setValue method.

this.gantt.setValue("3, 'lastName', 'Green'");

sortBy( columnDataField: string, sortOrder?: string): void

Sorts the Table by a column.

Arguments

columnDataFieldstring

Column field name.

sortOrder?string

Sort order. Possible values: 'asc' (ascending), 'desc' (descending), and null (removes sorting by column). If not provided, toggles the sorting.


Invoke the sortBy method.

this.gantt.sortBy("firstName");

setColumnProperty( columnDataField: string, propertyName: string, propertyValue: any): void

Sets a column property.

Arguments

columnDataFieldstring

Column field name.

propertyNamestring

Column property name.

propertyValueany

Property value.


Invoke the setColumnProperty method.

this.gantt.setColumnProperty("firstName","width","300");

updateRow( rowId: string | number, data: any): void

Updates a table row. The method expects two parameters - row id and JSON object with the new row data.

Arguments

rowIdstring | number

The id of the row.

dataany

JSON object with the new row's data. Example: {firstName: 'Peter', lastName: 'Fuller'}.


Invoke the updateRow method.

this.gantt.updateRow(3,{"firstName":"Peter","lastName":"Fuller"});

unselect( rowId: string | number | (string | number)[]): void

Unselects one or more rows.

Arguments

rowIdstring | number | (string | number)[]

The id of the row (or an array of row ids) to unselect.


Invoke the unselect method.

this.gantt.unselect(5);

TableColumnGroup

Inputs

labelstring

Sets or gets the column group's label that appears in the column header hierarchy.

Default value

""

Get the label property.

 let label = this.gantt.columnGroups[0].label;

namestring

Sets or gets the column group's unique name that is referenced in the columnGroup field of columns (TableColumn).

Default value

""

Get the name property.

 let name = this.gantt.columnGroups[0].name;

parentGroupstring

Sets or gets the name of the column group's parent group (also defined in columnGroups).

Default value

"null"

Get the parentGroup property.

 let parentGroup = this.gantt.columnGroups[0].parentGroup;

TableColumn

Inputs

allowEditboolean

Sets or gets whether the column's cells can be edited.

Default value

true

Get the allowEdit property.

 let allowEdit = this.gantt.columns[0].allowEdit;

allowFilterboolean

Sets or gets whether the column can be filtered.

Default value

true

Get the allowFilter property.

 let allowFilter = this.gantt.columns[0].allowFilter;

allowResizeboolean

Sets or gets whether the column can be resized.

Default value

true

Get the allowResize property.

 let allowResize = this.gantt.columns[0].allowResize;

allowSortboolean

Sets or gets whether the table can be sorted by the column.

Default value

true

Get the allowSort property.

 let allowSort = this.gantt.columns[0].allowSort;

columnGroupstring

Sets or gets the column's column group. Has to correspond to the name field of a column group (TableColumnGroup).

Default value

"null"

Get the columnGroup property.

 let columnGroup = this.gantt.columns[0].columnGroup;

dataFieldstring

Sets or gets the column's data source-bound field.

Default value

""

Get the dataField property.

 let dataField = this.gantt.columns[0].dataField;

dataTypeTableColumnDataType

Sets or gets the data type of the column's cells.

Default value

"string"

Get the dataType property.

 let dataType = this.gantt.columns[0].dataType;

freezeTableColumnFreeze

Sets or gets whether the column is sticky/frozen. true and 'near' designate freezing on the left side, 'far' - on the right side.

Get the freeze property.

 let freeze = this.gantt.columns[0].freeze;

formatFunctionany

A callback function that can be used to modify the contents of a cell and the cell itself.

Get the formatFunction property.

 let formatFunction = this.gantt.columns[0].formatFunction;

labelstring

Sets or gets the text displayed in the column's header.

Default value

""

Get the label property.

 let label = this.gantt.columns[0].label;

mapstring

Sets or gets the data field map, when the Table is bound to an Array and dataSourceSettings property is not set.

Default value

""

Get the map property.

 let map = this.gantt.columns[0].map;

responsivePrioritynumber | null

Sets or gets the column's priority when resizing the browser window. The larger the priority value, the column will be hidden at a larger screen resolution. Columns with priority 1 are never hidden. The property should be set to a number in the range of 1 to 5. The property by default is not set.

Get the responsivePriority property.

 let responsivePriority = this.gantt.columns[0].responsivePriority;

sortany

Use this for custom sort implementation only. All non-undefined array elements are sorted according to the return value of the compare function (all undefined elements are sorted to the end of the array, with no call to compareFunction).

Get the sort property.

 let sort = this.gantt.columns[0].sort;

templateElementstring

A string to be parsed into HTML and be used as custom cell content. Applicable only when virtualization is enabled.

Default value

"null"

Get the templateElement property.

 let templateElement = this.gantt.columns[0].templateElement;

templateElementSettingsany

A callback function that can be used to apply settings to a template element (specified by the column templateElement property). Applicable only when virtualization is enabled.

Get the templateElementSettings property.

 let templateElementSettings = this.gantt.columns[0].templateElementSettings;

transformany

A callback function that can be used to transform all the data of the column's original data field into a new data field to be used in column cells and all column operations. Can be useful for localizing data.

Get the transform property.

 let transform = this.gantt.columns[0].transform;

validationany

A callback function that can be used to validate cell values after editing. If it returns true, the cell is valid. If it returns false or an object with a message field, the cell is not valid and the message (or a default one) is displayed in a tooltip.

Get the validation property.

 let validation = this.gantt.columns[0].validation;

visibleboolean

Sets or gets whether the column is hidden or not. Hidden columns allow data to be grouped by their corresponding dataField.

Default value

true

Get the visible property.

 let visible = this.gantt.columns[0].visible;

widthstring | number

Sets the width of the column. The width can be entered as a number or string with px.

Get the width property.

 let width = this.gantt.columns[0].width;

GanttDataSourceSettings

Inputs

autoGenerateColumnsboolean

Sets or gets whether a column will be auto-generated.

Default value

false

Example

Set the autoGenerateColumns property by using the component's instance.

 this.gantt.dataSourceSettings[0].autoGenerateColumns = false;

Get the autoGenerateColumns property.

 let autoGenerateColumns = this.gantt.dataSourceSettings[0].autoGenerateColumns;

childrenDataFieldstring

Sets or gets a children data field like 'children', 'items' in the data source. When this property is set, the dataAdapter will look for this data field when looping through the items. If it is found a hierarchical data source would be created.

Default value

""

Example

Set the childrenDataField property by using the component's instance.

 this.gantt.dataSourceSettings[0].childrenDataField = 'children';

Get the childrenDataField property.

 let childrenDataField = this.gantt.dataSourceSettings[0].childrenDataField;

rootstring

Sets or gets the XML binding root.

Default value

""

Example

Set the root property by using the component's instance.

 this.gantt.dataSourceSettings[0].root = 'children';

Get the root property.

 let root = this.gantt.dataSourceSettings[0].root;

sanitizeHTMLGanttDataSourceSettingsSanitizeHTML

Sets or gets the XML binding root.

Default value

"blackList"

Example

Set the sanitizeHTML property by using the component's instance.

 this.gantt.dataSourceSettings[0].sanitizeHTML = 'blackList';

Get the sanitizeHTML property.

 let sanitizeHTML = this.gantt.dataSourceSettings[0].sanitizeHTML;

recordstring

Sets or gets the XML binding record.

Default value

""

Example

Set the record property by using the component's instance.

 this.gantt.dataSourceSettings[0].record = 'children';

Get the record property.

 let record = this.gantt.dataSourceSettings[0].record;

groupBystring[]

Sets or gets the data fields to group by.

Default value

[]

Example

Set the groupBy property by using the component's instance.

 this.gantt.dataSourceSettings[0].groupBy = true;

Get the groupBy property.

 let groupBy = this.gantt.dataSourceSettings[0].groupBy;

dataFieldsGanttDataSourceSettingsDataField[]

Sets or gets the data fields which decribe the loaded data and data type. Ex: ['id: number', 'firstName: string', 'lastName: string']

Example

Set the dataFields property by using the component's instance.

 this.gantt.dataSourceSettings[0].dataFields = [id: number];

Get the dataFields property.

 let dataFields = this.gantt.dataSourceSettings[0].dataFields;

dataSourceTypeGanttDataSourceSettingsDataSourceType

Sets or gets whether the data source type.

Default value

"array"

Example

Set the dataSourceType property by using the component's instance.

 this.gantt.dataSourceSettings[0].dataSourceType = 'json';

Get the dataSourceType property.

 let dataSourceType = this.gantt.dataSourceSettings[0].dataSourceType;

idstring

Sets or gets the dataAdapter's id

Default value

""

Get the id property.

 let id = this.gantt.dataSourceSettings[0].id;

keyDataFieldstring

Sets or gets the key data field to be used for building the hierarchy. It is used in combination with the parentDataField property. Usually the 'id' field is used as key data field and 'parentId' as parent data field'

Default value

""

Example

Set the keyDataField property by using the component's instance.

 this.gantt.dataSourceSettings[0].keyDataField = 'uid';

Get the keyDataField property.

 let keyDataField = this.gantt.dataSourceSettings[0].keyDataField;

parentDataFieldstring

Sets or gets the parent data field to be used for building the hierarchy. It is used in combination with the keyDataField property. Usually the 'id' field is used as key data field and 'parentId' as parent data field'

Default value

""

Example

Set the parentDataField property by using the component's instance.

 this.gantt.dataSourceSettings[0].parentDataField = 'uid';

Get the parentDataField property.

 let parentDataField = this.gantt.dataSourceSettings[0].parentDataField;

mapCharstring

Sets the 'mapChar' data field of the record

Default value

"."

Example

Set the mapChar property by using the component's instance.

 this.gantt.dataSourceSettings[0].mapChar = 'uid';

Get the mapChar property.

 let mapChar = this.gantt.dataSourceSettings[0].mapChar;

virtualDataSourceany

Sets the virtual data source function which is called each time the Grid requests data. Demos using 'virtualDataSource' are available on the Grid demos page.

Get the virtualDataSource property.

 let virtualDataSource = this.gantt.dataSourceSettings[0].virtualDataSource;

virtualDataSourceOnExpandany

Sets the virtual data source on expand function. This function is called when we load data on demand in Tree or TreeGrid and virtualDataSource in these components is set, too

Get the virtualDataSourceOnExpand property.

 let virtualDataSourceOnExpand = this.gantt.dataSourceSettings[0].virtualDataSourceOnExpand;
Sets the grid's data source settings when the dataSource property is set to an Array or URL.

GanttDataSourceSettingsDataField

Inputs

namestring

Sets the dataField name.

Default value

""

Get the name property.

 let name = this.gantt.dataSourceSettings[0].dataFields[0].name;

mapstring

Sets the dataField mapping path. For nested mapping, use '.'. Example: 'name.firstName'.

Default value

""

Get the map property.

 let map = this.gantt.dataSourceSettings[0].dataFields[0].map;

dataTypeGanttDataSourceSettingsDataFieldDataType

Sets the dataField type.

Default value

"string"

Get the dataType property.

 let dataType = this.gantt.dataSourceSettings[0].dataFields[0].dataType;

GanttModule

import { NgModule } from '@angular/core';
import { GanttComponent } from './smart.gantt';

@NgModule({
  declarations: [GanttComponent],
  exports: [GanttComponent]
})

export class GanttModule { }

Example

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { GanttModule } from 'smart-webcomponents-angular/gantt';
import { AppComponent } from './app.component';

@NgModule({
	declarations: [ AppComponent ],
	imports: [ BrowserModule, GanttModule ],
	bootstrap: [ AppComponent ],
	entryComponents: [ AppComponent ]
})

export class AppModule { }