I'd like to use the grid(){} builder method from somewhere, where the generic class T is not available as a reified class, but I have a klass: KClass<T> variable.
I'd like to add the following methods for the Grid.kt:
@VaadinDsl
public inline fun <T : Any?> (@VaadinDsl HasComponents).grid(
klass: KClass<T>,
dataProvider: DataProvider<T, *>? = null,
noinline block: (@VaadinDsl Grid<T>).() -> Unit = {}
): Grid<T> {
val grid = Grid<T>(klass.java, false)
if (dataProvider != null) {
grid.dataProvider = dataProvider
}
grid.hotfixMissingHeaderRow()
return init(grid, block)
}
Hi Vilmos, sure thing, that looks really useful. However, please make sure that Karibu-DSL doesn't need to depend on kotlin-reflect after this kind of change.
Hi there,
I'd like to use the
grid(){}
builder method from somewhere, where the generic classT
is not available as a reified class, but I have aklass: KClass<T>
variable.I'd like to add the following methods for the
Grid.kt
:And the same one for the
treeGrid
builder.Would you merge a PR like this?
Thanks, Vilmos