From 0acabe1d44111a3a118116d526b415572caf8050 Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Mon, 8 Jul 2019 12:43:17 +0200 Subject: New tabulator-remote module. --- .../kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'kvision-modules/kvision-remote/src') diff --git a/kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt b/kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt index 7db690b2..5b5ae87f 100644 --- a/kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt +++ b/kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt @@ -139,6 +139,17 @@ actual open class KVServiceManager actual constructor(serviceClass: KCl calls[function.toString().replace("\\s".toRegex(), "")] = Pair("/kv/$routeDef", HttpMethod.POST) } + /** + * Binds a given function of the receiver as a tabulator component source + * @param function a function of the receiver + */ + protected actual inline fun bind( + noinline function: T.(Int?, Int?, List?, List?) -> RemoteData + ) { + val routeDef = "route${this::class.simpleName}${counter++}" + calls[function.toString().replace("\\s".toRegex(), "")] = Pair("/kv/$routeDef", HttpMethod.POST) + } + /** * Binds a given web socket connetion with a function of the receiver. * @param function a function of the receiver -- cgit