Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boolean type field results data not rendered. #61

Open
logysis opened this issue Sep 15, 2017 · 1 comment
Open

Boolean type field results data not rendered. #61

logysis opened this issue Sep 15, 2017 · 1 comment

Comments

@logysis
Copy link

logysis commented Sep 15, 2017

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: "xxx@xxx.com",
enabled: true,
test: true,
permissions: getUserPermission(UserTypes.MASTER)
}
]

@hyojin
Copy link
Owner

hyojin commented Sep 19, 2017

@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>)
},
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants