Eureka
Eureka copied to clipboard
[Question] Is it possible to block the entire form for editing?
I didn't find any issue related to my question. I would like to block the form from editing, is it possible to do it? Or I have to go into every cell and "disable" any editing from them?
I tried
for row in form.allRows {
row.disabled = true
}
however it didn't work
@mtnbarreto do you know why
for row in form.allRows {
row.disabled = true
}
tableView.reloadData()
doing this doesn't work, however if I set the row.disabled in the initialisation block it works?
@mtnbarreto I made one workaround.
first, I create an hidden SwitchRow
<<< SwitchRow("enabled") {
$0.hidden = true
}
then, a disabling Condition.function
private let disabledFunction = Condition.function(["enabled"]) { form in
if let row = form.rowBy(tag: "enabled") as? SwitchRow {
return (row.value ?? false)
}
return false
}
After re-setting disabled or hidden for a row you should call evaluateDisabled or evaluateHidden to force apply this change. That is possibly why your above code didn't work