ve.Table

ve.Component. ve.Table

Refer to ve.Component for methods or fields inherited from this Component's parent such as .options.attributes or .element.

Table that be converted to and from ve.Spreadsheet and back. Only takes in a 2D array list. Any edits in spreadsheet mode will be converted back to the view-only mode if possible.

  • Functional binding: veTable().
Constructor:
  • arg0_value: Array<Array<any>>
    • Nested arrays: [n1] - Sheet, [n2] - Row
  • arg1_options: Object
    • .disable_hide_columns=[]: Array<number> - The indices of columns to disable hiding for.
    • .hide_columns=[]: Array<number>|string - The indices of columns to hide. If set to 'all', columns are not able to be hidden.
    • .non_sortable_columns: number - The indices that shouldn't be sortable.
    • .ondraw: function(v:ve.Table)
    • .oncellclick: function(v:Array<any>, e:Event)
    • .onrowclick: function(v:any, e:Event)
    • .page_sizes=ve.registry.settings.Table.page_sizes: number[] - Set by default to [10, 20, 50, 100].
    • .page_size=50: number
    • .sortable=true: boolean
    • .sort_ascending=true: boolean
    • .sort_column: number - Which column should have its sort indicator active. 0-indexed.
    • .dark_mode=false: boolean - Whether the spreadsheet editor should launch in dark mode.
Instance:
Methods:
  • convertToSpreadsheet() | ve.Spreadsheet
  • convertToTable() | ve.Table
  • draw()
  • drawPages()
  • sort(arg0_index:number)

Constructor

new ve.Table()

Source:

Extends

Members

v :Array.<Array.<any>>

Returns a 2D array of current values.

Source:
Type:

from_binding

Internal .from_binding setter for handling .options.from_binding. Accepts a string literal that is then parsed to a variable reference.

.to_binding counterparts are manually handled child-side.

Overrides:
Source:

limit

Tests the current this.limit by calling this.limit_function(this.v, this). Otherwise resolves to true if no .options.limit is set.

Overrides:
Source:

name

Returns the visual name of the present ve.Component,

Overrides:
Source:

Methods

convertToSpreadsheet() → {ve.Spreadsheet}

Switches the view to the bound Spreadsheet. If no Spreadsheet exists, creates one.

Source:
Returns:
Type:
ve.Spreadsheet

convertToTable() → {ve.Table}

Switches the view to the bound Table. If no Table exists, creates one.

  • Method of: ve.Spreadsheet
Source:
Returns:
Type:
ve.Table

convertToTable() → {ve.Table|ve.Component.Table}

Restores the Table view. If the Spreadsheet is currently active, it syncs the data back from the Spreadsheet before swapping.

  • Method of: ve.Spreadsheet
Source:
Returns:
Type:
ve.Table | ve.Component.Table

drawPages() → {ve.Table}

Draws the pagination menu at the bottom.

Source:
Returns:
Type:
ve.Table

getViewState() → {Object}

Returns the current view state of the component.

Source:
Returns:
Type:
Object

openViewSettings()

Opens the view settings tab for the component.

Source:

setViewState(arg0_view_obj)

Sets the view state from an existing view object.

Source:
Parameters:
Name Type Description
arg0_view_obj Object

sort(arg0_indexopt, arg1_optionsopt)

Sorts the current Table component and calls this.draw(). If the value is an HTMLElement with attribute 'data-value', it will use that to sort instead of innerHTML.

Source:
Parameters:
Name Type Attributes Description
arg0_index number <optional>
arg1_options Object <optional>
Name Type Attributes Default Description
do_not_change_sort_order boolean <optional>
false

addComponent()

Adds the current component to this.parent_el should it exist.

Overrides:
Source:

bind(arg0_container_el)

Manually binds/mounts the present ve.Component into the visual DOM.

Overrides:
Source:
Parameters:
Name Type Description
arg0_container_el HTMLElement

fireFromBinding()

Pseudo-setter from binding. Fires only upon program-driven changes to .v directly, which means that this has to be monitored manually component-side in set v(). This should always come last in set v().

Overrides:
Source:

fireToBinding()

Pseudo-setter to binding. Fires only upon user-driven changes, which means that this has to be monitored manually component-side.

Overrides:
Source:

gc()

Adds the current component to the garbage collector.

Overrides:
Source:

remove()

Removes the component/element from the DOM.

Overrides:
Source:

removeComponent()

Removes the current component from this.parent_el should it exist.

Overrides:
Source:

setOwner(arg0_value, arg1_owner_array)

Sets the root parent and ownership tree. Influences this.parent_el, this.owner, this.owners.

Overrides:
Source:
Parameters:
Name Type Description
arg0_value
arg1_owner_array

setValueFromObject(arg0_object, arg1_object)

Destructures Object values and transfers them into the .v instance fields of each Vercengen component.

Overrides:
Source:
Parameters:
Name Type Description
arg0_object Object

The Vercengen object to transfer to.

arg1_object Object

The other object to transfer from.