Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling and Enabling Row not update #1303

Closed
JonathanImperato opened this issue Oct 30, 2017 · 3 comments
Closed

Disabling and Enabling Row not update #1303

JonathanImperato opened this issue Oct 30, 2017 · 3 comments

Comments

@JonathanImperato
Copy link

JonathanImperato commented Oct 30, 2017

I have 2 different rows in a section:

        form
            +++ Section("Visita di ritorno"){
                $0.tag = "sezione"
            }
            <<< TextAreaRow(){ row in
                row.title = "Informazioni Trattate"
                row.placeholder = "Inserire le informazioni trattate qua"
                row.tag = "infotrattate"
                row.value = data.0
                row.disabled = true
                }
            <<< DateInlineRow(){
                $0.title = "Data contatto"
                $0.value = Date()
                $0.tag = "data"
                $0.disabled = true
                $0.value = dateResult
                }

on a click of my UIBarButtonItem i want to make them enabled, i am doing it in this way:

        let InfoRow: TextAreaRow? = form.rowBy(tag: "infotrattate")
        let dataRow: DateInlineRow? = form.rowBy(tag: "data")
        let sezione: Section? = form.sectionBy(tag: "sezione")
        InfoRow?.disabled = false
        dataRow?.disabled = false
        InfoRow?.reload()
        dataRow?.reload()
        sezione?.reload()

But it is not working. What is wrong?

@ghost
Copy link

ghost commented Nov 26, 2017

I am see the same also:
let submitRow: ButtonRow = form.rowBy(tag: "SubmitButtonRowTag")!
submitRow.disabled = true
form.sectionBy(tag: "SubmitSectionTag")?.reload()

@m-revetria
Copy link
Member

Hi @JonathanImperato, as it is pointed out in the Contributing guidelines we don't use Github issues for general library support. In such cases, the best option is posting questions on StackOverflow with tag eureka-forms.

This will help us to better manage real bugs and feature requests and also we think you'll get better and faster support for this kind of questions from community through StackOverflow.


That being said, you have to call evaluateDisabled function in order to reflect the changes to the disabled property.

let InfoRow: TextAreaRow? = form.rowBy(tag: "infotrattate")
InfoRow?.disabled = false
InfoRow?.evaluateDisabled()

https://github.com/xmartlabs/Eureka#row-does-not-update-after-changing-hidden-or-disabled-condition

@m-revetria
Copy link
Member

I'm closing this due to lack of response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants