Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit 0a0afed

Browse files
Add comment about why the 'actions' property is being patched on
1 parent 0ad0483 commit 0a0afed

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

samples/react/ReactGrid/ReactApp/components/PeopleGrid.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { fakeData } from '../data/fakeData.js';
55
import { columnMeta } from '../data/columnMeta.jsx';
66
const resultsPerPage = 10;
77

8-
const fakeDataWithAction = fakeData.map(data => Object.assign(data, {actions: ''}));
8+
// Griddle requires each row to have a property matching each column, even if you're not displaying
9+
// any data from the row in that column
10+
fakeData.forEach(row => { row.actions = ''; });
911

1012
export class PeopleGrid extends React.Component {
1113
render() {
@@ -14,7 +16,7 @@ export class PeopleGrid extends React.Component {
1416
<div>
1517
<h1>People</h1>
1618
<div id="table-area">
17-
<Griddle results={fakeDataWithAction}
19+
<Griddle results={fakeData}
1820
columns={columnMeta.map(x => x.columnName)}
1921
columnMetadata={columnMeta}
2022
resultsPerPage={resultsPerPage}

0 commit comments

Comments
 (0)