Skip to content

Displayif inside Array #1200

Answered by radekmie
uenokazuma asked this question in Q&A
Dec 16, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Hey @uenokazuma. You can access the context.name to know "where" in the tree (i.e., in which list element) is the condition evaluated. Here's an example:

<ListField>
    <ListItemField name="$">
      <AutoField name="field1" />
        <DisplayIf condition={({ model, name }) => model.fieldA[name[name.length - 1]]}>
            <TextField name="field2" />
          </DisplayIf>
        </section>
      </DisplayIf>
    </ListItemField>
</ListField>

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@uenokazuma
Comment options

Answer selected by radekmie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants