toString

Returns a string that represents the current row.

toString is the formatting method in the crud-node. It converts a row to its string representation so that it is suitable for display.

The default implementation of the toString method returns the id of a document, and <unknown> if a document is not defined.

To override toString formatting, add to document schema toString method.

Signature

The same on all adapters

toString(document?: IDocument<S>): string;

Example

enum EmployeeProps {
  _id = '_id',
  lastName = 'lastName',
  firstName = 'firstName',
  ....
}

...

toString: (data: IDocument<EmployeeProps>) => {
    return `${data.firstName} ${data.lastName}`;
},

Last updated