aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/pl/treksoft/kvision/panel/ResponsiveGridPanel.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/pl/treksoft/kvision/panel/ResponsiveGridPanel.kt')
-rw-r--r--src/main/kotlin/pl/treksoft/kvision/panel/ResponsiveGridPanel.kt8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/kotlin/pl/treksoft/kvision/panel/ResponsiveGridPanel.kt b/src/main/kotlin/pl/treksoft/kvision/panel/ResponsiveGridPanel.kt
index 93588617..8831e905 100644
--- a/src/main/kotlin/pl/treksoft/kvision/panel/ResponsiveGridPanel.kt
+++ b/src/main/kotlin/pl/treksoft/kvision/panel/ResponsiveGridPanel.kt
@@ -50,11 +50,12 @@ internal data class WidgetParam(val widget: Component, val size: Int, val offset
* @param cols number of columns
* @param align text align of grid cells
* @param classes a set of CSS class names
+ * @param init an initializer extension function
*/
open class ResponsiveGridPanel(
private val gridsize: GRIDSIZE = GRIDSIZE.MD,
private var rows: Int = 0, private var cols: Int = 0, align: ALIGN? = null,
- classes: Set<String> = setOf()
+ classes: Set<String> = setOf(), init: (ResponsiveGridPanel.() -> Unit)? = null
) : SimplePanel(classes) {
/**
@@ -69,6 +70,11 @@ open class ResponsiveGridPanel(
internal val map = mutableMapOf<Int, MutableMap<Int, WidgetParam>>()
private var auto: Boolean = true
+ init {
+ @Suppress("LeakingThis")
+ init?.invoke(this)
+ }
+
/**
* Adds child component to the grid.
* @param child child component