Class: AutomaticTable

.Presentation. AutomaticTable


new AutomaticTable()

Augmented.Presentation.AutomaticTable

Creates a table automatically via a schema for defintion and a uri/json for data

Source:

Extends

Members


<static> columns

Source:

<static> crossOrigin

The crossOrigin property - enables cross origin fetch

Properties:
Name Type Description
crossOrigin boolean

The crossOrigin property

Source:

<static> description

The description property

Properties:
Name Type Description
description string

The description of the table

Source:

<static> editable

The editable property - enables editing of cells

Properties:
Name Type Description
editable boolean

The editable property

Source:

<static> isInitalized

The initialized property

Properties:
Name Type Description
isInitalized boolean

The initialized property

Source:

<static> lineNumbers

The lineNumber property - turns on line numbers

Properties:
Name Type Description
lineNumbers boolean

The lineNumbers property

Source:

<static> linkable

The linkable property - enable links in a row (only works in non-editable tables)

Properties:
Name Type Description
linkable boolean

enable/disable linking a row

Source:

The links property - setup linking structure for links in a row

Properties:
Name Type Description
linkable boolean

enable/disable linking a row

Source:
Example
links: {
wholeRow: false, // link whole row vs column
column: "name", // name of column
	link: "rowLink" // callback
}

<static> localStorage

The localStorage property - enables localStorage

Properties:
Name Type Description
localStorage boolean

The localStorage property

Source:

<static> localStorageKey

The localStorageKey property - set the key for use in storage

Properties:
Name Type Description
localStorageKey string

The localStorage key property

Source:

<static> name

The name property

Properties:
Name Type Description
name string

The name of the table

Source:

<static> paginationAPI

The paginationAPI property - setup the paginatin API to use

Properties:
Name Type Description
paginationAPI Augmented.PaginationFactory.type

the pagination API to use

Source:

<static> renderPaginationControl

The renderPaginationControl property - render the pagination control

Properties:
Name Type Description
renderPaginationControl boolean

render the pagination control

Source:

<static> rows

Source:

<static> selectable

The selectable property - enable selecting a row in table

Properties:
Name Type Description
selectable boolean

enable/disable selecting a row

Source:

<static> sortable

The sortable property - enable sorting in table

Properties:
Name Type Description
sortable boolean

enable sorting in the table

Source:

<static> sortStyle

The sortStyle property - setup the sort API

Properties:
Name Type Description
sortStyle string

setup the sort API

Source:

<static> uri

The URI property

Properties:
Name Type Description
uri string

The URI property

Source:

Methods


<static> clear()

Clear all the data in the table

Source:

<static> clearCell(row, col)

Clear a cell at the row and column specified

Parameters:
Name Type Description
row number

The row

col number

The column

Source:

<static> compileTemplate()

An overridable template compile

Source:
Returns:

Returns the template

Type
string

<static> copyCell(row1, col1, row2, col2)

Copy a cell at the row and column to another

Parameters:
Name Type Description
row1 number

The 'from' row

col1 number

The 'from' column

row2 number

The 'to' row

col2 number

The 'to' column

Source:

<static> currentPage()

Return the current page number

Source:
Returns:

The current page number

Type
number

<static> display()

Fields to display - null will display all

Source:

<static> editCell(row, col, value)

Edit a cell at the row and column specified

Parameters:
Name Type Description
row number

The row

col number

The column

value any

The value to set

Source:

<static> exportTo Exports the table(type)

Export the table data in requested format

Parameters:
Name Type Description
type string

The type requested (csv or html-default)

Source:
Returns:

The table data in requested format

Type
string

<static> fetch()

Fetch the data from the source URI

Source:

<static> firstPage()

Return to the first page

Source:

<static> getSelected()

Gets the selected models

Source:
Returns:

Returns array of selected rows (models)

Type
Array

<static> getSelectedIndex()

Gets the selected row indexes

Source:
Returns:

Returns array of selected rows (indexes)

Type
Array

<static> goToPage(page)

Go to a specific page

Parameters:
Name Type Description
page number

The page to go to

Source:

<static> initialize(options)

Initialize the table view

Parameters:
Name Type Description
options object

The view options

Source:
Returns:

Returns true on success of initalization

Type
boolean

<static> isValid()

Is the table valid

Source:
Returns:

Returns true if valid

Type
boolean

<static> lastPage()

Advance to the last page

Source:

<static> nextPage()

Advance to the next page

Source:

<static> populate(source)

Populate the data in the table

Parameters:
Name Type Description
source array

The source data array

Source:

<static> previousPage()

Return to the previous page

Source:

<static> refresh Refresh the table()

Refresh the table (Same as render)

Source:
See:
  • Augmented.Presentation.AutomaticTable.render
Returns:

Returns the view context ('this')

Type
object

<static> remove()

Remove the table and all binds

Source:

<static> removeRows(rows)

Removes the models

Parameters:
Name Type Description
rows Array

Models of the rows to remove

Source:

<static> render Renders the table()

Render the table

Source:
Returns:

Returns the view context ('this')

Type
object

<static> retrieveSchema(uri)

Fetch the schema from the source URI

Parameters:
Name Type Description
uri string

the URI to fetch from

Source:

The default rowlink function callback called by row to format a link

Parameters:
Name Type Description
row array

The row data

Source:
Returns:

Returns the link uri

Type
string

<static> save(override)

Save the data to the source
This only functions if the table is editable

Parameters:
Name Type Description
override boolean

Save even if not editable

Source:
Returns:

Returns true if succesfull


<static> setSchema(schema)

Sets the schema

Parameters:
Name Type Description
schema object

The JSON schema of the dataset

Source:

<static> setURI(uri)

Sets the URI

Parameters:
Name Type Description
uri string

The URI

Source:

<static> showMessage(message)

Show a message related to the table

Parameters:
Name Type Description
message string

Some message to display

Source:

<static> showProgressBar(show)

Enable/Disable the progress bar

Parameters:
Name Type Description
show boolean

Show or Hide the progress bar

Source:

<static> sortBy(key)

Sort the tabe by a key (sent via a UI Event)

Parameters:
Name Type Description
key string

The key to sort by

Source:

<static> totalPages()

Return the total pages

Source:
Returns:

The total pages

Type
number

<static> validate()

Validate the table

Source:
Returns:

Returns true on success of validation

Type
boolean