Class Index | File Index

Classes


Class links.TreeGrid


Defined in: treegrid.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
links.TreeGrid(container, options)
Method Summary
Method Attributes Method Name and Description
<static>  
links.TreeGrid.addEventListener(element, action, listener, useCapture)
Add and event listener.
 
collapse(items)
Collapse one or multiple items
 
draw(data, options)
Main drawing logic.
<static>  
links.TreeGrid.eval(fn, obj)
Evaluate given function with a custom current object When the given fn is a string, it will be evaluated WARNING: evaluating fn when it is a string is unsafe.
 
expand(items)
Expand one or multiple items
<static>  
links.TreeGrid.extend(obj, newProps)
Recursively extend obj with all properties in newProps.
<static>  
links.TreeGrid.Frame(container, options)
The Frame is the base for a TreeGrid, it creates a DOM container and creates scrollbars etc.
<static>  
links.TreeGrid.getItemFromTarget(target)
Recursively find the treegrid item of which this target element is a part of.
 
Get the selected items
<static>  
links.TreeGrid.getTarget(event)
Get HTML element which is the target of the event
<static>  
links.TreeGrid.isArray(obj)
Check if given object is a Javascript Array
<static>  
links.TreeGrid.mergeArray(array1, array2)
merge two arrays returns a copy of the merged arrays, containing only distinct elements
<static>  
links.TreeGrid.Node()
Base prototype for Frame, Grid, and Item
<static>  
links.TreeGrid.preventDefault(event)
Cancels the event if it is cancelable, without stopping further propagation of the event.
 
Redraw the TreeGrid.
<static>  
links.TreeGrid.removeEventListener(element, action, listener, useCapture)
Remove an event listener from an element
 
setSelection(items)
Set the selected items
<static>  
links.TreeGrid.stopPropagation(event)
Stop event propagation
 
trigger(event, params)
fire an event
<static>  
links.TreeGrid.VerticalScroll(container, min, max, value)
Class Detail
links.TreeGrid(container, options)
Parameters:
{Element} container
The DOM element in which the TreeGrid will be created. Normally a div element.
{Object} options
Method Detail
<static> links.TreeGrid.addEventListener(element, action, listener, useCapture)
Add and event listener. Works for all browsers
Parameters:
{Element} element
An html element
{string} action
The action, for example 'click', without the prefix 'on'
{function} listener
The callback function to be executed
{boolean} useCapture

collapse(items)
Collapse one or multiple items
Parameters:
{Object | Object[]} items
A single object or an array with multiple objects

draw(data, options)
Main drawing logic. This is the function that needs to be called in the html page, to draw the TreeGrid. A data table with the events must be provided, and an options table.
Parameters:
{links.DataConnector} data
A DataConnector
{Object} options
A name/value map containing settings for the TreeGrid. Optional.

<static> links.TreeGrid.eval(fn, obj)
Evaluate given function with a custom current object When the given fn is a string, it will be evaluated WARNING: evaluating fn when it is a string is unsafe. It is safer to provide fn as a javascript function.
Parameters:
{function or String} fn
{Object} obj

expand(items)
Expand one or multiple items
Parameters:
{Object | Object[]} items
A single object or an array with multiple objects

<static> links.TreeGrid.extend(obj, newProps)
Recursively extend obj with all properties in newProps.
Parameters:
{Object} obj
{Object} newProps

<static> links.TreeGrid.Frame(container, options)
The Frame is the base for a TreeGrid, it creates a DOM container and creates scrollbars etc.
Parameters:
container
options

<static> {links.TreeGrid.Item} links.TreeGrid.getItemFromTarget(target)
Recursively find the treegrid item of which this target element is a part of.
Parameters:
{Element} target
Returns:
{links.TreeGrid.Item} item Item or undefined when not found

{Array[]} getSelection()
Get the selected items
Returns:
{Array[]} selected items

<static> {Element} links.TreeGrid.getTarget(event)
Get HTML element which is the target of the event
Parameters:
{MouseEvent} event
Returns:
{Element} target element

<static> {Boolean} links.TreeGrid.isArray(obj)
Check if given object is a Javascript Array
Parameters:
{*} obj
Returns:
{Boolean} isArray true if the given object is an array

<static> links.TreeGrid.mergeArray(array1, array2)
merge two arrays returns a copy of the merged arrays, containing only distinct elements
Parameters:
array1
array2

<static> links.TreeGrid.Node()
Base prototype for Frame, Grid, and Item

<static> links.TreeGrid.preventDefault(event)
Cancels the event if it is cancelable, without stopping further propagation of the event.
Parameters:
event

redraw()
Redraw the TreeGrid. This method can be used after the size of the TreeGrid changed, for example due to resizing of the page

<static> links.TreeGrid.removeEventListener(element, action, listener, useCapture)
Remove an event listener from an element
Parameters:
{Element} element
An html dom element
{string} action
The name of the event, for example 'mousedown'
{function} listener
The listener function
{boolean} useCapture

setSelection(items)
Set the selected items
Parameters:
{Array[] | Object} items
a single item or array with items

<static> links.TreeGrid.stopPropagation(event)
Stop event propagation
Parameters:
event

trigger(event, params)
fire an event
Parameters:
{String} event
The name of an event, for example 'rangechange' or 'edit'
{Object} params
Optional object with parameters

<static> links.TreeGrid.VerticalScroll(container, min, max, value)
Parameters:
{Element} container
Scroll bar will be created inside this container
{Number} min
Minimum value for the scrollbar
{Number} max
Maximum value for the scrollbar
{Number} value
Current value of the scrollbar

Documentation generated by JsDoc Toolkit 2.3.2 on Fri Nov 20 2015 11:10:07 GMT+0100 (CET)