kvision / pl.treksoft.kvision.form / FormControl

FormControl

interface FormControl : Component

Base interface of a form control.

Properties

disabled

open var disabled: Boolean

Determines if the field is disabled.

flabel

abstract val flabel: FieldLabel

Form field label.

input

abstract val input: FormInput

The actual input component.

invalidFeedback

abstract val invalidFeedback: InvalidFeedback

Invalid feedback component.

name

open var name: String?

The name attribute of the generated HTML input element.

size

open var size: InputSize?

Input control field size.

validationStatus

open var validationStatus: ValidationStatus?

Input control validation status.

validatorError

open var validatorError: String?

Validator error message.

Inherited Properties

parent

abstract var parent: Container?

Parent of the current component.

visible

abstract var visible: Boolean

Visibility state of the current component.

Functions

blur

abstract fun blur(): Unit

Makes the input element blur.

focus

abstract fun focus(): Unit

Makes the input element focused.

getValue

abstract fun getValue(): Any?

Returns the value of the control.

getValueAsString

abstract fun getValueAsString(): String?

Returns the value of the control as a String.

setValue

abstract fun setValue(v: Any?): Unit

Sets the value of the control.

styleForHorizontalFormPanel

open fun styleForHorizontalFormPanel(horizontalRatio: FormHorizontalRatio): Unit

Style form control element for horizontal form panel.

styleForInlineFormPanel

open fun styleForInlineFormPanel(): Unit

Style form control element for inline form panel.

styleForVerticalFormPanel

open fun styleForVerticalFormPanel(): Unit

Style form control element for vertical form panel.

Inherited Functions

addCssClass

abstract fun addCssClass(css: String): Component

Adds given value to the set of CSS classes generated in html code of current component.

addCssStyle

abstract fun addCssStyle(css: Style): Component

Adds given style object to the set of CSS classes generated in html code of current component.

addSurroundingCssClass

abstract fun addSurroundingCssClass(css: String): Component

Adds given value to the set of CSS classes generated in html code of parent component.

addSurroundingCssStyle

abstract fun addSurroundingCssStyle(css: Style): Component

Adds given style object to the set of CSS classes generated in html code of parent component.

getAttribute

abstract fun getAttribute(name: String): String?

Returns the value of an additional attribute.

getElement

abstract fun getElement(): Node?

Returns DOM element bound to the current component.

getElementJQuery

abstract fun getElementJQuery(): JQuery?

Returns JQuery element bound to the current component.

getElementJQueryD

abstract fun getElementJQueryD(): dynamic

Returns JQuery element bound to the current component as a dynamic type.

removeAttribute

abstract fun removeAttribute(name: String): Component

Removes the value of additional attribute.

removeCssClass

abstract fun removeCssClass(css: String): Component

Removes given value from the set of CSS classes generated in html code of current component.

removeCssStyle

abstract fun removeCssStyle(css: Style): Component

Removes given style object from the set of CSS classes generated in html code of current component.

removeSurroundingCssClass

abstract fun removeSurroundingCssClass(css: String): Component

Removes given value from the set of CSS classes generated in html code of parent component.

removeSurroundingCssStyle

abstract fun removeSurroundingCssStyle(css: Style): Component

Removes given style object from the set of CSS classes generated in html code of parent component.

setAttribute

abstract fun setAttribute(name: String, value: String): Component

Sets the value of additional attribute.

Extension Functions

addBsBgColor

fun Component.addBsBgColor(bsBgColor: BsBgColor): Unit

addBsBorder

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

addBsClearfix

fun Component.addBsClearfix(): Unit

addBsColor

fun Component.addBsColor(bsColor: BsColor): Unit

addBsRounded

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

createInstance

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

Helper function for creating JavaScript objects from dynamic constructors.

removeBsBgColor

fun Component.removeBsBgColor(bsBgColor: BsBgColor): Unit

removeBsBorder

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

removeBsClearfix

fun Component.removeBsClearfix(): Unit

removeBsColor

fun Component.removeBsColor(bsColor: BsColor): Unit

removeBsRounded

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

Inheritors

BoolFormControl

interface BoolFormControl : FormControl

Base interface of a form control with a boolean value.

DateFormControl

interface DateFormControl : FormControl

Base interface of a form control with a date value.

KFilesFormControl

interface KFilesFormControl : FormControl

Base interface of a form control with a list of files value.

NumberFormControl

interface NumberFormControl : FormControl

Base interface of a form control with a numeric value.

StringFormControl

interface StringFormControl : FormControl

Base interface of a form control with a text value.