JavaScript API Reference/Ab.timeline.TimelineController object

addColumn(id, name, type, eventHandler, text, imageName)

Add a fixed column to the timeline. The timeline can have fixed columns that look like a grid report. Fixed columns are not used for drag-and-drop, and typically display properties of the resource objects displayed in timeline rows. For example, if the timeline displays rooms, fixed columns may display room location, area, or standard. In addition, like in a regular report, fixed columns can be used to display buttons, links or images.

Parameters:

  • id (String): Unique column id that you can later use to access the column data
  • name (String): Column title that is displayed in the timeline header row
  • type (String): Column type; supports the same types as Ab.grid.Grid
  • eventHandler (function reference): If the column contains a button, link, clickable image or another type of input control, the function will be called when the user clicks on a control. The function should be defined in your code, and should accept two parameters:
    • e : reference to the browser event that is being handled, in this case click event
    • resource : Ab.timeline.Resource object for the timeline row that the user clicked on.
  • text (String): (optional) if the column contains a button or link, the text will be displayed as a button/link text; if the column contains an image, the text will be displayed as an image tooltip
  • imageName (String): (optional) if the column displays an image, the name of the image file that should be displayed;


Examples:

Add a text column that displays room location, with localized column title:

timeline.addColumn(
'roomLocation',
getMessage('roomLocationTitle'),
'text');


Add a radio button without column title (to save horizontal space):

timeline.addColumn(
'roomLocation',
getMessage('roomLocationTitle'),
'text');


Add an action button:

timeline.addColumn(
'viewDetails',
'',
'button',
onViewDetails,
getMessage('viewDetailsButtonText'));


Add an image button:

timeline.addColumn(
'viewDetails',
'',
'image',
onViewDetails,
getMessage('viewDetailsTooltip'),
'schema\\ab-products\\product\\activity\\details.gif');