kvision / pl.treksoft.kvision.html / ListTag

ListTag

open class ListTag : SimplePanel

HTML list component.

The list component can be populated directly from elements parameter or manually by adding any Component to the container.

Constructors

<init>

ListTag(type: ListType, elements: List<String>? = null, rich: Boolean = false, classes: Set<String> = setOf(), init: (ListTag.() -> Unit)? = null)

Properties

elements

var elements: List<String>?

List of elements.

rich

var rich: Boolean

Determines if elements can contain HTML code.

type

var type: ListType

List type.

Functions

childrenVNodes

open fun childrenVNodes(): Array<VNode>

Returns the array of the children Snabbdom vnodes.

getSnClass

open fun getSnClass(): List<StringBoolPair>

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

render

open fun render(): VNode

Renders current component as a Snabbdom vnode.

Inherited Functions

add

open fun add(child: Component): SimplePanel

Adds given component to the current container.

addAll

open fun addAll(children: List<Component>): SimplePanel

Adds a list of components to the current container.

addInternal

fun addInternal(child: Component): SimplePanel

Protected and final method to add given component to the current container.

getChildren

open fun getChildren(): List<Component>

Returns a list of children of the current container.

remove

open fun remove(child: Component): SimplePanel

Removes given component from the current container.

removeAll

open fun removeAll(): SimplePanel

Removes all children from the current container.

Companion Object Functions

listTag

fun Container.listTag(type: ListType, elements: List<String>? = null, rich: Boolean = false, classes: Set<String> = setOf(), init: (ListTag.() -> Unit)? = null): ListTag

DSL builder extension function.

Extension Functions

createInstance

fun <T> Any?.createInstance(vararg args: dynamic): T

Helper function for creating JavaScript objects from dynamic constructors.

Inheritors

ContextMenu

open class ContextMenu : ListTag

Context menu component.