aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/data
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/data')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/data/DataContainer.kt8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/data/DataContainer.kt b/src/main/kotlin/pl/treksoft/kvision/data/DataContainer.kt
index fa545dc8..c008c47b 100644
--- a/src/main/kotlin/pl/treksoft/kvision/data/DataContainer.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/data/DataContainer.kt
@@ -126,7 +126,7 @@ class DataContainer<M : DataComponent, C : Component>(
companion object {
/**
- * DSL builder extension function
+ * DSL builder extension function.
*
* It takes the same parameters as the constructor of the built component.
*/
@@ -135,8 +135,10 @@ class DataContainer<M : DataComponent, C : Component>(
binding: (Int) -> C,
child: Container = VPanel(),
init: (DataContainer<M, C>.() -> Unit)? = null
- ) {
- this.add(DataContainer(model, binding, child, init))
+ ): DataContainer<M, C> {
+ val dataContainer = DataContainer(model, binding, child, init)
+ this.add(dataContainer)
+ return dataContainer
}
}
}