ve.CRUD

ve.Component. ve.CRUD

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

Create, Read, Update, Delete (CRUD) interface used for editing complex instances.

  • Functional binding: veCRUD().
Constructor:
  • arg0_value: Array<any>
  • arg1_options: Object
    • .header=["Selected", "Index", ...]: Array<string>

    • .special_function: function(v:any) | Array<any> - How to parse Array elements in the dataframe into rows, excluding the selection row.

    • .filters: Array<Object> - [{ name: "All" }] by default.

      • [n].name: string - The name of the given tab.
      • [n].special_function: function(v:any) | boolean - Boolean determines whether to include result in tab. If this field does not exist, all elements are taken as valid.
    • .filter_interface: ve.Interface - The interface to provide for the filter.

    • .hide_searchbar=false: boolean

    • .onsearch: function(v:string, e:ve.CRUD)

    • .onselect: function(v:boolean, e:{ checkbox:ve.Checkbox, value:any })

    • .searchbar_filters: Array<number> - The column indices to target when filtering search results.

    • .searchbar_header_components: Array<ve.Component>

    • .searchbar_options: Object - The options to pass to the ve.SearchSelect for the CRUD.

    • .select_options: Object

    • .table_options: Object - The options to pass to the ve.Table for the CRUD.

Instance:
  • .do_not_draw=false: boolean - Whether to call .draw() when set v() is fired.
  • .page_menu: ve.PageMenu - The PageMenu component responsible for containing CRUD subpages.
  • .searchbar: ve.SearchSelect
  • .table: ve.Table
  • .table_array: Array<Array<any>>
  • .table_map: Array<Object{ <value_id>: { value:any, row:any[] } }>
  • .v: Array<any>
Methods:
  • draw()
  • filterTable(arg0_search_string:string, arg1_options:Object) | Array<any>
  • gc()
  • getFilters() | Object{ name:string, special_function:function }
  • getTable(arg0_filter_function:function) | Array<Array<any>>
  • redrawSelections()

Constructor

new ve.CRUD()

Source:

Extends

Members

v :Array.<any>

Returns an array of current values.

  • Accessor of: ve.CRUD
Source:
Type:

v

Sets the array of current values.

  • Accessor of: ve.CRUD
Source:

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

draw()

Draws the current component and forces a re-render.

  • Method of: ve.CRUD
Source:

filterTable(arg0_search_stringopt, arg1_optionsopt) → {Array.<any>}

Filters the current table depending on the search string given.

  • Method of: ve.CRUD
Source:
Parameters:
Name Type Attributes Default Description
arg0_search_string string <optional>
""
arg1_options Object <optional>
Name Type Attributes Default Description
do_not_refresh boolean <optional>
false
Returns:
Type:
Array.<any>

getFilters() → {Array.<{name: string, special_function: (function()|undefined)}>}

Returns all internal filters and sets them to this.options._filters.

  • Method of: ve.CRUD
Source:
Returns:
Type:
Array.<{name: string, special_function: (function()|undefined)}>

getTable(arg0_filter_functionopt) → {Array.<Array.<any>>}

Returns the current table array for the CRUD component.

  • Method of: ve.CRUD
Source:
Parameters:
Name Type Attributes Description
arg0_filter_function function <optional>

The function to filter this.value[i] by. Returns: boolean.

Returns:
Type:
Array.<Array.<any>>

redrawSelections()

Redraws selection boxes for the present component.

  • Method of: ve.CRUD
Source:

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.