ron
10/07/2018, 7:21 PMkotlin
class AuthorTableView : View() {
private val controller: MainController by inject()
override val root = tableview<EntryWithTypes> {
columnResizePolicy = SmartResize.POLICY
column("title", EntryWithTypes::title).remainingWidth()
column("types", EntryWithTypes::types).contentWidth(padding=50.0)
onSelectionChange {
if(selectedItem!=null) {
runAsync {
readStoryInformation(selectedItem!!.url)
} ui {
controller.storyModel.item = it
}
}
}
controller.authorModel.itemProperty.onChange {
runAsync {
val strip = controller.authorModel.url.value.substring(controller.authorModel.url.value.indexOf("/Authors"))
readIndex(controller.authorModel.url.value, strip, true)
} ui {
items = it.observable()
}
}
}
}