kvision / pl.treksoft.kvision.tabulator / Tabulator

Tabulator

(js) open class Tabulator<T : Any> : Widget

Tabulator component.

Constructors

(js)

<init>

Tabulator(data: List<T>? = null, dataUpdateOnEdit: Boolean = true, options: TabulatorOptions<T> = TabulatorOptions(), types: Set<TableType> = setOf(), classes: Set<String> = setOf())

Properties

(js)

data

a list of objects

val data: List<T>?
(js)

dataUpdateOnEdit

determines if the data model is automatically updated after tabulator edit action

val dataUpdateOnEdit: Boolean
(js)

filter

var filter: ((T) -> Boolean)?
(js)

jsTabulator

Native Tabulator object.

var jsTabulator: Tabulator?
(js)

options

tabulator options

val options: TabulatorOptions<T>
(js)

types

Table types.

var types: Set<TableType>

Functions

(js)

addColumn

Add new column to the tabulator.

open fun addColumn(columnDefinition: ColumnDefinition<T>, insertRightOfTarget: Boolean? = null, positionTarget: String? = null): Unit
open fun addColumn(columnDefinition: ColumnDefinition, insertRightOfTarget: Boolean? = null, positionTarget: String? = null): Unit
(js)

afterDestroy

Method called after destroying Snabbdom vnode.

open fun afterDestroy(): Unit
(js)

afterInsert

Method called after inserting Snabbdom vnode into the DOM.

open fun afterInsert(node: VNode): Unit
(js)

applyFilter

Applies the current filter.

open fun applyFilter(): Unit
(js)

clearData

Clears the data in the table.

open fun clearData(): Unit?
(js)

clearFilter

Clears current filters.

open fun clearFilter(includeHeaderFilters: Boolean = true): Unit
(js)

clearHeaderFilter

Clears header filters.

open fun clearHeaderFilter(): Unit
(js)

clearSort

Clears current sort.

open fun clearSort(): Unit
(js)

createJsTabulator

Creates internal JS Tabulator object

fun createJsTabulator(): Unit
(js)

deleteColumn

Delete column by name.

open fun deleteColumn(name: String): Unit
(js)

deselectRow

Deselect the row given by id.

open fun deselectRow(row: Int): Unit
(js)

downloadCSV

Download the table content as CSV

open fun downloadCSV(fileName: String? = null, dataSet: RowRangeLookup = RowRangeLookup.ACTIVE, delimiter: Char = ',', includeBOM: Boolean = false, newTab: Boolean = false): Unit?
(js)

downloadHTML

Download the table content as HTML

open fun downloadHTML(fileName: String? = null, dataSet: RowRangeLookup = RowRangeLookup.ACTIVE, style: Boolean = false, newTab: Boolean = false): Unit?
(js)

downloadJSON

Download the table content as JSON

open fun downloadJSON(fileName: String? = null, dataSet: RowRangeLookup = RowRangeLookup.ACTIVE, newTab: Boolean = false): Unit?
(js)

getColumn

Get column component by name.

open fun getColumn(name: String): ColumnComponent?
(js)

getData

Returns the current data in the table.

open fun getData(dataSet: DataSet?): List<T>?
(js)

getDataCount

Get the number of data rows.

open fun getDataCount(dataSet: DataSet?): Int
(js)

getHistoryRedoSize

Get the number of history redo actions available.

open fun getHistoryRedoSize(): Int
(js)

getHistoryUndoSize

Get the number of history undo actions available.

open fun getHistoryUndoSize(): Int
(js)

getHtml

Get the HTML code of the table.

open fun getHtml(rowRangeLookup: RowRangeLookup, isStyled: Boolean = false, htmlOutputConfig: dynamic = null): String?
(js)

getPage

Returns current page number.

open fun getPage(): Int
(js)

getPageMax

Returns number of pages.

open fun getPageMax(): Int
(js)

getPageSize

Returns the size of a page.

open fun getPageSize(): Int
(js)

getSelectedData

Returns the selected data in the table.

open fun getSelectedData(): List<T>
(js)

getSelectedRows

Returns the selected rows.

open fun getSelectedRows(): List<RowComponent>
(js)

getSnClass

Returns list of CSS class names for current widget in the form of a List.

open fun getSnClass(): List<StringBoolPair>
(js)

navigateDown

Navigate to the same cell in the row below.

open fun navigateDown(): Unit
(js)

navigateLeft

Navigate to the cell on the left.

open fun navigateLeft(): Unit
(js)

navigateNext

Navigate to the next cell.

open fun navigateNext(): Unit
(js)

navigatePrev

Navigate to the previous cell.

open fun navigatePrev(): Unit
(js)

navigateRight

Navigate to the cell on the right.

open fun navigateRight(): Unit
(js)

navigateUp

Navigate to the same cell in the row above.

open fun navigateUp(): Unit
(js)

nextPage

Navigate to the next page.

open fun nextPage(): Unit
(js)

previousPage

Navigate to the previous page.

open fun previousPage(): Unit
(js)

print

Print the table.

open fun print(rowRangeLookup: RowRangeLookup, isStyled: Boolean = false, printConfig: dynamic = null): Unit?
(js)

redo

Redo the last undone user action.

open fun redo(): Boolean
(js)

redraw

Redraw the table (e.g. after a resize).

open fun redraw(force: Boolean = false): Unit
(js)

reload

Reload table data.

open fun reload(): Unit
(js)

render

Renders current component as a Snabbdom vnode.

open fun render(): VNode
(js)

replaceData

Silently replaces the data in a table.

open fun replaceData(data: Array<T>): Unit
(js)

scrollToRow

Scroll to the row given by id.

open fun scrollToRow(row: Int, position: RowPosition? = null, ifVisible: Boolean? = null): Unit
(js)

selectRow

Select the row given by id.

open fun selectRow(row: Int): Unit
(js)

setData

Sets new data in a table.

open fun setData(data: Array<T>): Unit
(js)

setFilter

Sets the external filter for the data.

open fun setFilter(filter: (T) -> Boolean): Unit
(js)

setHeight

Change the height of the table.

open fun setHeight(height: Int): Unit
(js)

setPage

Shows given page.

open fun setPage(page: Int): Unit
(js)

setPageSize

Set the size of a page.

open fun setPageSize(size: Int): Unit
(js)

setPageToRow

Shows page with a row given by id.

open fun setPageToRow(row: Int): Unit
(js)

toggleSelectRow

Toggle selection status of the row given by id.

open fun toggleSelectRow(row: Int): Unit
(js)

undo

Undo the last user action.

open fun undo(): Boolean

Companion Object Functions

(js)

create

A helper function to create a Tabulator object with correct serializer.

fun <T : Any> create(data: List<T>? = null, dataUpdateOnEdit: Boolean = true, options: TabulatorOptions<T> = TabulatorOptions(), types: Set<TableType> = setOf(), classes: Set<String> = setOf(), init: (Tabulator<T>.() -> Unit)? = null): Tabulator<T>

A helper function to create a Tabulator object with correct serializer and a general observable store.

fun <T : Any, S : Any> create(store: ObservableState<S>, dataFactory: (S) -> List<T>, options: TabulatorOptions<T> = TabulatorOptions(), types: Set<TableType> = setOf(), classes: Set<String> = setOf(), init: (Tabulator<T>.() -> Unit)? = null): Tabulator<T>

Extension Properties

(js)

changeFlow

Extension property returning Flow for a change event.

val <T : Widget> T.changeFlow: Flow<T>
(js)

clickFlow

Extension property returning Flow for a click event.

val <T : Widget> T.clickFlow: Flow<T>
(js)

inputFlow

Extension property returning Flow for an input event.

val <T : Widget> T.inputFlow: Flow<T>

Extension Functions

(js)

addBsBgColor

fun Component.addBsBgColor(bsBgColor: BsBgColor): Unit
(js)

addBsBorder

fun Component.addBsBorder(vararg bsBorder: BsBorder): Unit
(js)

addBsClearfix

fun Component.addBsClearfix(): Unit
(js)

addBsColor

fun Component.addBsColor(bsColor: BsColor): Unit
(js)

addBsRounded

fun Component.addBsRounded(vararg bsRounded: BsRounded): Unit
(js)

bind

An extension function which binds the widget to the observable state.

fun <S, W : Widget> W.bind(observableState: ObservableState<S>, removeChildren: Boolean = true, factory: W.(S) -> Unit): W
(js)

contextMenu

DSL builder extension function.

fun Widget.contextMenu(fixedPosition: Boolean = false, classes: Set<String>? = null, className: String? = null, init: (ContextMenu.() -> Unit)? = null): ContextMenu
(js)

enableGestureDetector

Enable gesture detector for a given Widget.

fun Widget.enableGestureDetector(): Unit
(js)

eventFlow

Extension property returning Flow<Pair<Widget, Event>> for a given event

fun <T : Widget> T.eventFlow(event: String): Flow<Pair<T, Event>>
(js)

onClick

An extension function for defining on click event handlers.

fun <T : Widget> T.onClick(handler: T.(MouseEvent) -> Unit): Int
(js)

onEvent

An extension function for defining event handlers.

fun <T : Widget> T.onEvent(block: SnOn<T>.() -> Unit): Int
(js)

removeBsBgColor

fun Component.removeBsBgColor(bsBgColor: BsBgColor): Unit
(js)

removeBsBorder

fun Component.removeBsBorder(vararg bsBorder: BsBorder): Unit
(js)

removeBsClearfix

fun Component.removeBsClearfix(): Unit
(js)

removeBsColor

fun Component.removeBsColor(bsColor: BsColor): Unit
(js)

removeBsRounded

fun Component.removeBsRounded(vararg bsRounded: BsRounded): Unit
(js)

setContextMenu

Sets context menu for the current widget.

fun Widget.setContextMenu(contextMenu: ContextMenu): Widget
(js)

style

DSL builder extension function.

fun Widget.style(className: String? = null, init: (Style.() -> Unit)? = null): Style

Inheritors

(js)

TabulatorRemote

Tabulator component connected to the multiplatform service.

open class TabulatorRemote<T : Any, E : Any> : Tabulator<T>