bietkul / react-native-form-builder

Handle your forms in a smart way
MIT License
121 stars 68 forks source link

how to show hidden fields #19

Closed prajayan76 closed 5 years ago

prajayan76 commented 5 years ago

var fieldsHidden = true ... ... ...

onValueChange(){ const formValues = this.formGenerator.getValues(); formValues.selectname['id'] !== '1' ? fieldsHidden = false : fieldsHidden = true }

const fields = [

{ type: 'select', name: 'Organization', multiple: false, required: true, label: 'OrganizationType', labelKey: 'name', primaryKey: 'id', objectType: true, options: [ // required { id: 1, name: 'Health',

  },
  {
    id: 2,
    name: 'Finance',

  }

],
defaultValue: [{
    id: 1,
    name: 'Health',
  }],

},

{ type: 'text', name: CompanyName', label: 'Company Name', hidden: fieldsHidden, }, ]

its not working

luissmg commented 5 years ago

You can't right now. The lib does not update the fields. I will do a PR for this once the owner of the project @bietkul answers my email.