How can I display a custom list of templates in Navigator?

55 Views Asked by At

The Navigator tool comes with the ability to display custom tables, defined through the frontend-config.js file. The quickstart example contains such a file that defines a custom list of contracts.

Is it also possible to display a custom list of templates?

1

There are 1 best solutions below

0
On

To add a custom list of templates, add a custom view with source.type=="templates".

Here is an example of a custom view that would list all tempaltes that have "Iou:Iou" in their template ID:

  iouTemplates: {
    type: "table-view",
    title: "Iou Templates",
    source: {
      type: "templates",
      filter: [
        {
          field: "id",
          value: "Iou:Iou",
        }
      ],
      search: "",
      sort: [
        {
          field: "id",
          direction: "ASCENDING"
        }
      ]
    },
    columns: [
      {
        key: "id",
        title: "Template ID",
        createCell: ({rowData}) => ({
          type: "text",
          value: rowData.id
        }),
        sortable: true,
        width: 80,
        weight: 0,
        alignment: "left"
      }
    ]
  }