Guides
Guides

Custom Fields

Node field names are customizable using the following options:

  • childrenField
  • displayField
  • idField
  • isExpandedField
  • hasChildrenField

Example

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

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