Eureka: [Question] Is it possible to block the entire form for editing?

Created on 2 May 2019  路  4Comments  路  Source: xmartlabs/Eureka

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?

Most helpful comment

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

All 4 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

JonathanImperato picture JonathanImperato  路  3Comments

sedwo picture sedwo  路  3Comments

smileatom picture smileatom  路  3Comments

allanrojas picture allanrojas  路  3Comments

Tomas1405 picture Tomas1405  路  3Comments