Hi rnentjes.1 Thanks for replying.
So to enable some kind click action to the button there’s 2 option. I create an inline javascript code to handle the click that will be executed by the browser (?) or Using some kind of form submission for the button. Is there an example code for this 2 approach?
Sorry, receiver function is one of the concept I haven’t fully grasped in kotlin. So i tried to create a simple template using bootstrap that shows bootstrap grid. But it said the receiver doesn’t match. Here’s the code:
class BootstrapTemplate(val main : TwoColumnTemplate = TwoColumnTemplate(“two”)): Template {
val content = Placeholder()
override fun HTML.apply() {
head {
meta(charset = "utf-8")
meta(name = "viewport", content = "width=device-width, initial-scale=1, shrink-to-fit=no")
title { +"Tag" }
link(rel="stylesheet", href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css")
}
body {
insert(main) {
h1 {
+"Hello world"
}
div("container") {
div("row") {
div("col-md-2") { +"""Column left""" }
div("col-md-auto") { +"""Column right""" }
}
}
script{src = "https://code.jquery.com/jquery-3.5.1.min.js"}
script{src = "https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"}
script{src = "https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"}
}
}
}
class TwoColumnTemplate(val titleString: String) : Template {
val leftColumn = Placeholder()
val middleColumn = Placeholder()
override fun HTML.apply() {
head {
title { +titleString }
}
body {
div(“container”) {
div(“row”) {
div(“col-md-2”) { insert(leftColumn) }
div(“col-md-auto”) { +""“Column right”"" }
}
}
}
}
}