Show:

ia.Table Class

Defined in: ia\ui\Table.js:1
Module: ia

A class for rendering a data table.

Constructor

ia.Table

(
  • id
)

Defined in ia\ui\Table.js:1

Parameters:

  • id String

    The id of the table.

Methods

_addMouseEvents

(
  • obj
)
private

Defined in ia\ui\Table.js:454

Adds mouse events to the passed jquery object. Uses delegation to reduce number of events added to rows and rendering time!

Parameters:

  • obj JQUERY Element

    The jquery object.

_dispatchItemEvent

(
  • id
  • eventType
  • state
)
private

Defined in ia\ui\Table.js:747

Dispatches item events.

Parameters:

  • id String

    The id.

  • eventType String

    The event type.

  • state String

    The state.

_getColumnIndex

(
  • colId
)
Number private

Defined in ia\ui\Table.js:766

Returns the column index for the given column id.

Parameters:

  • colId String

    The column id.

Returns:

Number: The index of the column (first column is 0).

_scrollIntoView

(
  • element
)
private

Defined in ia\ui\Table.js:818

Scrolls a row into view.

Parameters:

  • element JQUERY Element

    The row as a jquery object.

_size

() private

Defined in ia\ui\Table.js:135

Sizes all the element to make the scrolling work.

addEventListener

(
  • eventType
  • fnc
  • obj
)

Add an event listener.

Parameters:

  • eventType String

    The type of event to listen for.

  • fnc Function

    The function to call when the event occurs.

  • obj Object

    An optional parent object.

clearHighlight

()

Defined in ia\ui\Table.js:904

Clears all highlights.

clearSelection

()

Defined in ia\ui\Table.js:862

Clears all selections.

dispatchEvent

(
  • event
)

Dispatch an event to the listeners.

Parameters:

  • event Object

    The event object.

exportData

(
  • txt
)

Defined in ia\ui\Table.js:335

Exports as an image in a new page.

Parameters:

  • txt String

    Any text to go with image.

getData

() Id:"eh11", name:"polwarth", value:2345, associate1:25

Defined in ia\ui\Table.js:161

Gets a data object for the table.

Returns:

Id:"eh11", name:"polwarth", value:2345, associate1:25: ["eh11"] ["eh12"]{id:"eh12", name:"morningside", value:4347, associate1:45} ["eh13"]{id:"eh13", name:"merchiston", value:2496, associate1:25}

highlight

(
  • rowId
)

Defined in ia\ui\Table.js:875

Hightlights a row.

Parameters:

  • rowId String

    The id of the row to select.

promoteToTop

(
  • ids
)

Defined in ia\ui\Table.js:705

Promotes a list of row ids to the the top of the table.

Parameters:

  • ids String

    The list of ids.

removeListener

(
  • obj
)

Removes all event listeners for the given object.

Parameters:

  • obj Object

    The object.

render

()

Defined in ia\ui\Table.js:187

Renders the table.

renderSelection

()

Defined in ia\ui\Table.js:437

Renders the selection.

select

(
  • rowId
)

Defined in ia\ui\Table.js:789

Selects a row.

Parameters:

  • rowId String

    The id of the row to select.

selectText

()

Defined in ia\ui\Table.js:721

Selects all the text in the table.

setData

(
  • value
)

Defined in ia\ui\Table.js:174

Sets a data object for the table.

Parameters:

  • value Id:"eh11", name:"polwarth", value:2345, associate1:25

    ["eh11"]
    ["eh12"]{id:"eh12", name:"morningside", value:4347, associate1:45}
    ["eh13"]{id:"eh13", name:"merchiston", value:2496, associate1:25}

sort

(
  • colIndex
  • sortDirection
)

Defined in ia\ui\Table.js:588

Sorts the table. The table must be rendered before it can be sorted.

Parameters:

  • colIndex Number

    The id of the column to sort by.

  • sortDirection String

    The sort direction "ascending" or "descending". Default is "ascending".

stickToTop

(
  • ids
)

Defined in ia\ui\Table.js:693

Sticks a list of row ids to the the top of the table.

Parameters:

  • ids String

    The list of ids.

unselect

(
  • rowId
)

Defined in ia\ui\Table.js:845

Unselects a row.

Parameters:

  • rowId String

    The id of the row to unselect.

Properties

allowUserSorting

Boolean

Defined in ia\ui\Table.js:101

Should user sorting be allowed.

Default: true

columns

JSON

Defined in ia\ui\Table.js:118

The columns to be rendered.

The columns are an array with the following structure: They dictate which columns should be used from the data. The id points to the id in the data.

[{id:"name", label:"Features", type:"categoric'"}, {id:"value", label:"Indicator", type:"numeric'"}, {id:"associate1", label:"Associate 1", type:"numeric'"}, {id:"associate2", label:"Associate 2", type:"categoric'"}]

container

JQUERY Element

Defined in ia\ui\Table.js:110

The container that holds the object.

highlightColor

String

Defined in ia\ui\Table.js:84

The item highlight color.

id

String

Defined in ia\ui\Table.js:68

The id.

selectionColor

String

Defined in ia\ui\Table.js:76

The item selection color.

showLegendColor

Boolean

Defined in ia\ui\Table.js:92

Should the legend color be displayed.

Default: true