We have updated WebDataRocks EULA, effective as of April 18, 2024. Learn more about what's changed.

React integration with Json

Resolved

How do i add JSON object to the grid in react? I wrote the following code but data is not showing on the grid:
 
const tableData =
[
{
“Product”: “Apple”,
“Price”: 2.50
},
{
“Product”: “Cherry”,
“Price”: 5.25
}
];
export class App extends React.PureComponent {

render() {
return (

<div>
<WebDataRocksReact.Pivot toolbar={true}
report= {tableData}
/>
</div>
);
}
}
export default App;
 

1 answer

Hugo Martinez October 26, 2018

Judging by this doc, I guess you need to set it the following way:
report={{dataSource: {data: tableData}}}