Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Table<C, R>

Table provides a smarter html table.

todo

split sort and select api into own table widgets.

Type parameters

  • C

  • R

Hierarchy

Implements

  • Widget

Index

Constructors

constructor

  • children is an array of content passed to this Component.

    Parameters

    Returns Table

Properties

attrs

attrs: TableAttrs<C, R>

children

children: Content[]

delegate

delegate: Delegate<C, R> = this.attrs.ww.delegate ?this.attrs.ww.delegate : new SortDelegate(this)

originalData

originalData: R[] = this.attrs.ww.data

view

view: View = new view.Main(this)

Methods

append

  • append(data: R | R[]): Table<C, R>
  • append adds one or more new data rows to the end of the table.

    Parameters

    • data: R | R[]

    Returns Table<C, R>

appendRow

  • appendRow(renderer: Renderable): Table<C, R>
  • appendRow appends customisable DOM content to the begining of the table body.

    NOTE: This DOM content of must be between elements.

    Parameters

    • renderer: Renderable

    Returns Table<C, R>

cellAt

  • cellAt(column: string, row: number): Maybe<Cell>
  • cellAt produces a Cell instance for the coordinates passed (if found).

    Parameters

    • column: string
    • row: number

    Returns Maybe<Cell>

modifyBody

  • modifyBody(f: function): Table<C, R>
  • modifyBody allows a function to modify the contents of the

    Parameters

    • f: function
        • (e: HTMLElement): void
        • Parameters

          • e: HTMLElement

          Returns void

    Returns Table<C, R>

prepend

  • prepend(data: R | R[]): Table<C, R>
  • prepend adds one or more new data rows to the begining of the table.

    Parameters

    • data: R | R[]

    Returns Table<C, R>

prependRow

  • prependRow(renderer: Renderable): Table<C, R>
  • prependRow prepends customisable DOM content to the begining of the table body.

    NOTE: This DOM content of must be between elements.

    Parameters

    • renderer: Renderable

    Returns Table<C, R>

removeRow

  • removeRow(index: number): Table<C, R>
  • removeRow will remove an entire row from the table given its index.

    Parameters

    • index: number

    Returns Table<C, R>

removed

  • removed(): void
  • Returns void

render

  • render(): Content
  • Returns Content

rendered

  • rendered(): void
  • Returns void

sort

  • sort(name: string): Table<C, R>

update

  • update(data: R[]): Table<C, R>

Object literals

values

values: object

arrow

arrow: string = ""

columns

columns: Column<C, R>[] = <Column<C, R>[]>this.attrs.ww.columns

data

data: R[] = this.originalData.slice()

empty

empty: Template = this.attrs.ww.empty

sortedOn

sortedOn: string = ""

options

options: object

selectable

selectable: boolean = this.attrs.ww.selectable

table

table: object

class

class: string = concat(TABLE, this.attrs.ww.class)

id

id: string = TABLE

tbody

tbody: object

id

id: string = TBODY

template

template: function = <TBody<C, R>>(this.attrs.ww.tbody || view.tbody)

Type declaration

    • (table: Table<C, R>): function
    • Parameters

      Returns function

        • (data: R[]): function
        • Parameters

          • data: R[]

          Returns function

            • (columns: Column<C, R>[]): Template
            • Parameters

              Returns Template

td

td: object

class

class: string = this.attrs.ww.tdClass

id

  • id(column: string, colNumber: number, rowNumber: number): string
  • Parameters

    • column: string
    • colNumber: number
    • rowNumber: number

    Returns string

onclick

  • onclick(value: C, column: string, rowData: R, rowNumber: number): (Anonymous function)
  • Parameters

    • value: C
    • column: string
    • rowData: R
    • rowNumber: number

    Returns (Anonymous function)

tr

tr: object

class

class: string = this.attrs.ww.trClass

onCheck

  • onCheck(row: R, index: number, data: R[]): (Anonymous function)

onclick

  • onclick(row: R, index: number, data: R[]): (Anonymous function)

thead

thead: object

class

class: string = this.attrs.ww.theadClass

id

id: string = THEAD

template

template: function = <THead<C, R>>(this.attrs.ww.thead || view.thead)

Type declaration

    • (table: Table<C, R>): function
    • Parameters

      Returns function

        • (columns: Column<C, R>[]): Template
        • Parameters

          Returns Template

onCheck

  • onCheck(): void

th

th: object

class

class: string = this.attrs.ww.thClass

onclick

  • onclick(field: string): (Anonymous function)

Generated using TypeDoc