kvision / pl.treksoft.kvision.form.time / DateTime / setEventListener

setEventListener

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

Sets an event listener for current widget, keeping the actual type of component.

Parameters

T - widget type

block - event handler

Return

id of the handler

Example:

    button.setEventListener<Button> {
        dblclick = {
            Alert.show("Button double clicked!")
            // self is of type Button here
        }
    }