Skip to content

Can I have DisplayField with more than 1 values? #793

@LynnWong5596

Description

@LynnWong5596

Im wondering can I assign DisplayField with more than 1 values?
For example, the normal situation is

nodes = [
    {
      _id: '1',
      title: 'root1',
      nodes: [{_id: '3', title: 'child1'}]
    },
    {
      _id: '2',
      title: 'root2'
    }
  ];

  options: ITreeOptions = {
    idField: '_id',
    displayField: 'title',
    childrenField: 'nodes'
  };

What Im try to achieve is something like

nodes = [
    {
      _id: '1',
      title: 'root1',
      nodes: [{_id: '3', title: 'child1'}]
    },
    {
      _id: '2',
      titleOption: 'root2',
      nodes: [{_id: '4', titleOption: 'child2'}]
    }
  ];

  options: ITreeOptions = {
    idField: '_id',
    displayField: 'title' || 'titleOption',
    childrenField: 'nodes'
  };

any way to achieve it?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions