aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-remote
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-07-08 12:43:17 +0200
committerRobert Jaros <rjaros@finn.pl>2019-07-08 12:43:17 +0200
commit0acabe1d44111a3a118116d526b415572caf8050 (patch)
treee252f8ddd28687a36477d7fdd125686e82f85386 /kvision-modules/kvision-remote
parentc0a51a9be91b8f438ec7605558465bf8a8aac404 (diff)
downloadkvision-0acabe1d44111a3a118116d526b415572caf8050.tar.gz
kvision-0acabe1d44111a3a118116d526b415572caf8050.tar.bz2
kvision-0acabe1d44111a3a118116d526b415572caf8050.zip
New tabulator-remote module.
Diffstat (limited to 'kvision-modules/kvision-remote')
-rw-r--r--kvision-modules/kvision-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt11
1 files changed, 11 insertions, 0 deletions
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
@@ -140,6 +140,17 @@ actual open class KVServiceManager<T : Any> actual constructor(serviceClass: KCl
}
/**
+ * Binds a given function of the receiver as a tabulator component source
+ * @param function a function of the receiver
+ */
+ protected actual inline fun <reified RET> bind(
+ noinline function: T.(Int?, Int?, List<RemoteFilter>?, List<RemoteSorter>?) -> RemoteData<RET>
+ ) {
+ 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
* @param route a web socket route