open class Upload : SimplePanel, KFilesFormControl
The form field file upload component.
Upload(uploadUrl: String? = null, multiple: Boolean = false, label: String? = null, rich: Boolean = false) |
var allowedFileExtensions: Set<String>?
Allowed file extensions. |
|
var allowedFileTypes: Set<String>?
Allowed file types. |
|
var browseOnZoneClick: Boolean
Determines if the click on the preview zone opens file browse window. |
|
var dropZoneEnabled: Boolean
Determines if Drag&Drop zone is enabled. |
|
var explorerTheme: Boolean
Determines if the explorer theme is used. |
|
val flabel: FieldLabel
Form field label. |
|
val idc: String |
|
val input: UploadInput
The actual input component. |
|
var label: String?
The label text bound to the spinner input element. |
|
var multiple: Boolean
Determines if multiple file upload is supported. |
|
var preferIconicPreview: Boolean
Determines if the iconic preview is prefered. |
|
var required: Boolean
Determines if the input selection is required. |
|
var rich: Boolean
Determines if label can contain HTML code. |
|
var showBrowse: Boolean
Determines if the file browse button is shown. |
|
var showCancel: Boolean
Determines if the cancel button is shown. |
|
var showCaption: Boolean
Determines if the caption is shown. |
|
var showPreview: Boolean
Determines if the preview is shown. |
|
var showRemove: Boolean
Determines if the remove button is shown. |
|
var showUpload: Boolean
Determines if the upload button is shown. |
|
var uploadExtraData: ((String, Int) -> dynamic)?
The extra data that will be passed as data to the AJAX server call via POST. |
|
var uploadUrl: String?
The optional URL for the upload processing action. If not set the upload button action will default to form submission. |
|
val validationInfo: HelpBlock
Validation info component. |
|
open var value: List<KFile>?
File input value. |
open fun blur(): Unit
Makes the input element blur. |
|
open fun cancel(): Unit
Cancel an ongoing ajax upload (only for ajax mode). |
|
open fun clearInput(): Unit
Clears the file input control (including the native input). |
|
open fun focus(): Unit
Makes the input element focused. |
|
open fun getNativeFile(kFile: KFile): File?
Returns the native JavaScript File object. |
|
open fun getSnClass(): List<StringBoolPair>
Returns list of CSS class names for current widget in the form of a List. |
|
open fun getValueAsString(): String?
Returns the value of the control as a String. |
|
open fun lock(): Unit
Locks the file input (disabling all buttons except a cancel button). |
|
open fun removeEventListeners(): Widget
Removes all event listeners from current widget. |
|
open fun resetInput(): Unit
Resets the file input control. |
|
open fun <T : Widget> setEventListener(block: SnOn<T>.() -> Unit): Widget
Sets an event listener for current widget, keeping the actual type of component. open fun setEventListener(block: SnOn<Widget>.() -> Unit): Widget
Sets an event listener for current widget. |
|
open fun unlock(): Unit
Unlocks the file input. |
|
open fun upload(): Unit
Trigger ajax upload (only for ajax mode). |
open fun add(child: Component): SimplePanel
Adds given component to the current container. |
|
open fun addAll(children: List<Component>): SimplePanel
Adds a list of components to the current container. |
|
fun addInternal(child: Component): SimplePanel
Protected and final method to add given component to the current container. |
|
open fun childrenVNodes(): Array<VNode>
Returns the array of the children Snabbdom vnodes. |
|
open fun getChildren(): List<Component>
Returns a list of children of the current container. |
|
open fun getValue(): List<KFile>?
Returns the value of the control. |
|
open fun remove(child: Component): SimplePanel
Removes given component from the current container. |
|
open fun removeAll(): SimplePanel
Removes all children from the current container. |
|
open fun render(): VNode
Renders current component as a Snabbdom vnode. |
|
open fun setValue(v: Any?): Unit
Sets the value of the control. |
fun Container.upload(uploadUrl: String? = null, multiple: Boolean = false, label: String? = null, rich: Boolean = false, init: (Upload.() -> Unit)? = null): Upload
DSL builder extension function. |
fun <T> Any?.createInstance(vararg args: dynamic): T
Helper function for creating JavaScript objects from dynamic constructors. |