Class: GanttChartDataFeed

GanttChartDataFeed

This class handles the data-related calculations for the GanttChart plugin.

handsontable-pro/src/plugins/ganttChart/ganttChartDataFeed.js, line 11

Methods

handsontable-pro/src/plugins/ganttChart/ganttChartDataFeed.js, line 32

applyData(data, startDateColumn, endDateColumn, additionalData, asyncUpdates)

Parse data accordingly to it's type (HOT instance / data object).

Parameters:
Name Type Description
data Object

The source Handsontable instance or a data object.

startDateColumn Number

Index of the column containing the start dates.

endDateColumn Number

Index of the column containing the end dates.

additionalData Object

Object containing column and label information about additional data passed to the Gantt Plugin.

asyncUpdates Boolean

If set to true, the source instance updates will be applied asynchronously.

handsontable-pro/src/plugins/ganttChart/ganttChartDataFeed.js, line 89

asyncCall(func)

Run the provided function asynchronously.

Parameters:
Name Type Description
func function
handsontable-pro/src/plugins/ganttChart/ganttChartDataFeed.js, line 70

bindWithHotInstance(instance, startDateColumn, endDateColumn, additionalData, asyncUpdates)

Make another Handsontable instance be a live feed for the gantt chart.

Parameters:
Name Type Description
instance Object

The source Handsontable instance.

startDateColumn Number

Index of the column containing the start dates.

endDateColumn Number

Index of the column containing the end dates.

additionalData Object

Object containing column and label information about additional data passed to the
Gantt Plugin. See the example for more details.

asyncUpdates Boolean

If set to true, the source instance updates will be applied asynchronously.

Example
hot.getPlugin('ganttChart').bindWithHotInstance(sourceInstance, 4, 5, {
 vendor: 0, // data labeled 'vendor' is stored in the first sourceInstance column.
 format: 1, // data labeled 'format' is stored in the second sourceInstance column.
 market: 2 // data labeled 'market' is stored in the third sourceInstance column.
});
handsontable-pro/src/plugins/ganttChart/ganttChartDataFeed.js, line 157

getDataFromSource(row){Array}

Get data from the source Handsontable instance.

Parameters:
Name Type Description
row Number optional

Source Handsontable instance row.

Returns: {Array}
handsontable-pro/src/plugins/ganttChart/ganttChartDataFeed.js, line 232

loadData(data)

Load chart data to the Handsontable instance.

Parameters:
Name Type Description
data Array

Array of objects containing the range data.

Example
[
 {
   additionalData: {vendor: 'Vendor One', format: 'Posters', market: 'New York, NY'},
   startDate: '1/5/2015',
   endDate: '1/20/2015'
 },
 {
   additionalData: {vendor: 'Vendor Two', format: 'Malls', market: 'Los Angeles, CA'},
   startDate: '1/11/2015',
   endDate: '1/29/2015'
 }
]
handsontable-pro/src/plugins/ganttChart/ganttChartDataFeed.js, line 255

splitRangeIfNeeded(bar){Array}

Split the provided range into maximum-year-long chunks.

Parameters:
Name Type Description
bar Object

The range bar object.

Returns: {Array} An array of slip chunks (or a single-element array, if no splicing occured)
handsontable-pro/src/plugins/ganttChart/ganttChartDataFeed.js, line 198

updateFromSource(row)

Update the Gantt Chart-enabled Handsontable instance with the data from the source Handsontable instance.

Parameters:
Name Type Description
row Number optional

Index of the row which needs updating.