diff options
author | Robert Jaros <rjaros@finn.pl> | 2019-07-08 12:43:17 +0200 |
---|---|---|
committer | Robert Jaros <rjaros@finn.pl> | 2019-07-08 12:43:17 +0200 |
commit | 0acabe1d44111a3a118116d526b415572caf8050 (patch) | |
tree | e252f8ddd28687a36477d7fdd125686e82f85386 /kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote | |
parent | c0a51a9be91b8f438ec7605558465bf8a8aac404 (diff) | |
download | kvision-0acabe1d44111a3a118116d526b415572caf8050.tar.gz kvision-0acabe1d44111a3a118116d526b415572caf8050.tar.bz2 kvision-0acabe1d44111a3a118116d526b415572caf8050.zip |
New tabulator-remote module.
Diffstat (limited to 'kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote')
-rw-r--r-- | kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt | 8 | ||||
-rw-r--r-- | kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/RemoteTypes.kt (renamed from kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/RemoteSelectOption.kt) | 9 |
2 files changed, 17 insertions, 0 deletions
diff --git a/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt b/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt index e89744f6..786143e8 100644 --- a/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt +++ b/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/KVServiceManager.kt @@ -119,6 +119,14 @@ expect open class KVServiceManager<T : Any>(serviceClass: KClass<T>) { ) /** + * Binds a given function of the receiver as a tabulator component source + * @param function a function of the receiver + */ + protected inline fun <reified RET> bind( + noinline function: T.(Int?, Int?, List<RemoteFilter>?, List<RemoteSorter>?) -> RemoteData<RET> + ) + + /** * Binds a given function of the receiver as a web socket connection * @param function a function of the receiver */ diff --git a/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/RemoteSelectOption.kt b/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/RemoteTypes.kt index 24e68f63..7285295b 100644 --- a/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/RemoteSelectOption.kt +++ b/kvision-modules/kvision-common-remote/src/main/kotlin/pl/treksoft/kvision/remote/RemoteTypes.kt @@ -34,3 +34,12 @@ data class RemoteSelectOption( val disabled: Boolean = false, val divider: Boolean = false ) + +@Serializable +data class RemoteData<T>(val data: List<T> = listOf(), val last_page: Int = 0) + +@Serializable +data class RemoteFilter(val field: String, val type: String, val value: String?) + +@Serializable +data class RemoteSorter(val field: String, val dir: String) |