From 5195caf0405eea7a6b34f60cb0a1bea3026bac3c Mon Sep 17 00:00:00 2001 From: Robert Jaros Date: Mon, 6 Nov 2017 12:13:52 +0100 Subject: Ajax support for Select, emptyOption support --- src/main/kotlin/pl/treksoft/kvision/Showcase.kt | 30 +++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/main/kotlin/pl/treksoft/kvision/Showcase.kt') diff --git a/src/main/kotlin/pl/treksoft/kvision/Showcase.kt b/src/main/kotlin/pl/treksoft/kvision/Showcase.kt index 985f9f98..a3fec251 100644 --- a/src/main/kotlin/pl/treksoft/kvision/Showcase.kt +++ b/src/main/kotlin/pl/treksoft/kvision/Showcase.kt @@ -187,6 +187,36 @@ class Showcase : ApplicationBase() { } root.add(select7) + val select8 = Select(label = "Wybierz repozytorium").apply { + emptyOption = true + ajaxOptions = AjaxOptions("https://api.github.com/search/repositories", processData = { + it.items.map { item -> + obj { + this.value = item.id + this.text = item.name + this.data = obj { + this.subtext = item.owner.login + } + } + } + }, processParams = obj { + q = "{{{q}}}" + }, minLength = 3, requestDelay = 1000) + setEventListener