Version 1.7 glow.widgets.Timetable.Item
API Quick Reference
JavaScript is required to use the quick reference
An Item is an "event" on a Track.
Constructor
An Item cannot be directly instantiated. Instead the addItem method of glow.widgets.Timetable.Track must be used.
Properties
- data
-
The Item's arbitrary data store
- Type
Description
This can be used to attach any arbitrary data to the Item, without the possibility of conflicting with the Item's designed properties.
Example
myItem.data.moreInfoUrl = "someUrl"; // used in the Item templare to provide a link to a "more info" page.
- element
-
The HTML element that represents the item in the Timetable.
- Type
- glow.dom.Nodelist
- end
-
The Item's end point
- Type
- |
- id
-
The Item's id
- Type
- start
-
The Item's start point
- Type
- |
- title
-
The Item's title
- Type
- track
-
The Item's parent Track
Methods
- getContent
-
Gets the actual content of the Item for the Timetable to display
Synopsis
myItem.getContent();
Returns
glow.dom.NodeList
- inRange
-
Returns true if the Item overlaps the range with the given start and end points
Synopsis
myItem.inRange();
Returns
Boolean
Example
var item = myTrack.addItem("Item", 1, 2); if (item.inRange(0, 1.5)) { // code here runs } if (item.inRange(3, 4)) { // code here doesn't run }
- setItemTemplate
-
Sets the Default Item template for the Timetable
Synopsis
myItem.setItemTemplate(template);
Parameters
- template
-
- Type
- | glow.dom.NodeList | function
The template to use
Returns
this
Description
The item will be passed into the template.
Further Info & Examples