diff options
Diffstat (limited to 'kvision-modules/kvision-tabulator')
3 files changed, 12 insertions, 1 deletions
diff --git a/kvision-modules/kvision-tabulator/build.gradle b/kvision-modules/kvision-tabulator/build.gradle index 5ea97e50..b74ef2d4 100644 --- a/kvision-modules/kvision-tabulator/build.gradle +++ b/kvision-modules/kvision-tabulator/build.gradle @@ -8,7 +8,7 @@ dependencies { kotlinFrontend { npm { - dependency("tabulator-tables", "4.2.5") + dependency("tabulator-tables", "4.2.7") devDependency("karma", "3.1.4") devDependency("karma-chrome-launcher", "2.2.0") devDependency("karma-webpack", "3.0.5") diff --git a/kvision-modules/kvision-tabulator/src/main/kotlin/pl/treksoft/kvision/tabulator/Options.kt b/kvision-modules/kvision-tabulator/src/main/kotlin/pl/treksoft/kvision/tabulator/Options.kt index 08f2603b..53f958e5 100644 --- a/kvision-modules/kvision-tabulator/src/main/kotlin/pl/treksoft/kvision/tabulator/Options.kt +++ b/kvision-modules/kvision-tabulator/src/main/kotlin/pl/treksoft/kvision/tabulator/Options.kt @@ -356,6 +356,7 @@ data class ColumnDefinition<T : Any>( internal object EditorRoot { internal var root: Root? = null + internal var cancel: ((value: dynamic) -> Unit)? = null internal var disposeTimer: Int? = null } @@ -384,6 +385,7 @@ fun <T : Any> ColumnDefinition<T>.toJs( root?.dispose() disposeTimer = null root = null + EditorRoot.cancel = null }, 500) }, cancel, data) val rootElement = document.createElement("div") as HTMLElement @@ -393,6 +395,7 @@ fun <T : Any> ColumnDefinition<T>.toJs( root?.dispose() } root = Root(element = rootElement) + EditorRoot.cancel = cancel @Suppress("UnsafeCastFromDynamic") root?.add(component) (component as? FormControl)?.focus() diff --git a/kvision-modules/kvision-tabulator/src/main/kotlin/pl/treksoft/kvision/tabulator/Tabulator.kt b/kvision-modules/kvision-tabulator/src/main/kotlin/pl/treksoft/kvision/tabulator/Tabulator.kt index 72a2809a..01af46c6 100644 --- a/kvision-modules/kvision-tabulator/src/main/kotlin/pl/treksoft/kvision/tabulator/Tabulator.kt +++ b/kvision-modules/kvision-tabulator/src/main/kotlin/pl/treksoft/kvision/tabulator/Tabulator.kt @@ -40,6 +40,7 @@ import pl.treksoft.kvision.utils.createInstance import pl.treksoft.kvision.utils.obj import pl.treksoft.kvision.utils.syncWithList import redux.RAction +import kotlin.browser.window import pl.treksoft.kvision.tabulator.js.Tabulator as JsTabulator /** @@ -558,6 +559,13 @@ open class Tabulator<T : Any>( jsTabulator?.navigateDown() } + internal fun removeCustomEditors() { + EditorRoot.cancel?.invoke(null) + EditorRoot.disposeTimer?.let { window.clearTimeout(it) } + EditorRoot.root?.dispose() + EditorRoot.root = null + } + companion object { internal var counter = 0 |