material-ui-datatables icon indicating copy to clipboard operation
material-ui-datatables copied to clipboard

Boolean type field results data not rendered.

Open logysis opened this issue 8 years ago • 1 comments

I have an array of users. "enabled" field can not be rendered, and console show this error: warning.js:36 Warning: Failed prop type: Invalid prop children supplied to DataTablesRowColumn, expected a ReactNode. in DataTablesRowColumn (created by DataTables) in DataTables..............

const Users = [ { id: newGuid(), userName: "MasterUser", userType: UserTypes.MASTER, timeZone: "", email: "[email protected]", enabled: true, test: true, permissions: getUserPermission(UserTypes.MASTER) } ]

logysis avatar Sep 15 '17 23:09 logysis

@logysis Hi, What are you going to display with "enabled" field? If it is "true" or "false" as string, then you can convert it to string before render or can use custom render function in your column settings. for example,

...
{
  key: 'enabled',
  render: (column, row) => (<span>{column ? column.toString() : 'false'}</span>)
},
...

hyojin avatar Sep 19 '17 01:09 hyojin