React Show / hide

clipboard.png

clipboard.png
when you add a new top level, there is no superior menu ID, to hide it
here I use a modal box

<Button icon="plus" type="primary" onClick={() => this.handleModalVisibleAdd(record)}>
  
</Button>
<Form>
  {/* {this.props.data.PARENT_ID ? (
    <FormItem
      {...formItemLayout}
      label="ID"
    >
      {getFieldDecorator("PARENT_ID", {
        initialValue: this.props.data.ID,
        rules: [{
          // required: true, message: "",
        }],
      })(
        <Input disabled />
      )}
    </FormItem>
  ) : null
  } */}

......

 </Form>

pasted part of the code to realize some problems
how to do it

Mar.05,2021

set a state value identity when the button is clicked.
is judged by this logo in Modal . This can be done through the ternary operator or & & .


<Form>
          {this.props.data.PARENT_ID && (
            <FormItem {...formItemLayout} label="ID">
              {getFieldDecorator('PARENT_ID', {
                initialValue: this.props.data.ID, rules: [{}],
              })(
                <Input disabled/>
              )}
            </FormItem>
          )}
        </Form>
Is that what

means? Want to use this.props.data.PARENT_ID to control your input ?

Menu