-1

i try to generate dynamically forms on admin-on-rest but i really don't have idea how generate it. I try:

class MultipleChoice extends Component {
constructor(props) {
    super(props);
    this.state = { inputs: ['input-0'] };
}

render() {
    return(
        <div>
           <Form>
               <div id="dynamicInput">
                   {this.state.inputs.map(input => <FormInput key={input} />)}
               </div>
           </Form>
           <button onClick={ () => this.appendInput() }>
               CLICK ME TO ADD AN INPUT
           </button>
        </div>
    );
}

appendInput() {
    var newInput = `input-${this.state.inputs.length}`;
    this.setState({ inputs: this.state.inputs.concat([newInput]) });
}
}

but i cant include on create of admin-on-rest any suggest is welcome, thanks

1 Answers1

-1

This should help you. Look at the last answer on the page about creating custom forms.

How to richly style AOR Edit page

You essentially need to also figure out a ways for AOR to take your inputs and outputs correctly.

kunal pareek
  • 1,285
  • 10
  • 21