<@U0F3291QE> I am trying to implement something ...
# tornadofx
a
@edvin I am trying to implement something in my todo application. when i select a checkbox, the label should get striked out I get the index of the item inside the action of checkbox and set the boolean to true but the observable list doesn't re-render when i edit it. Is there a way so that as soon as i check the checkbox the text get striked out?
Copy code
class MainView : View() {
    val persons: ObservableList<Person> = FXCollections.observableArrayList<Person>()
    override val root = vbox {
        textfield {
            action {
                persons.add(Person(text, false))
                clear()
            }
        }
        listview(persons) {
            cellFormat {
                graphic = cache {
                    form {
                        fieldset {
                            hbox {
                                checkbox {
                                    action {
                                        persons.get(persons.indexOf(it)).selection = !it.selection
                                    }
                                }
                                label(it.name) {
                                    style {
                                        fontSize = 12.px
                                    }
                                    toggleClass(Styles.strikethrough, it.selection)
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
class Person(val name: String, var selection: Boolean)