Add comment about why the 'actions' property is being patched on

This commit is contained in:
SteveSandersonMS
2016-08-18 13:57:49 -07:00
parent 0ad0483935
commit 0a0afed84b

View File

@@ -5,7 +5,9 @@ import { fakeData } from '../data/fakeData.js';
import { columnMeta } from '../data/columnMeta.jsx'; import { columnMeta } from '../data/columnMeta.jsx';
const resultsPerPage = 10; const resultsPerPage = 10;
const fakeDataWithAction = fakeData.map(data => Object.assign(data, {actions: ''})); // Griddle requires each row to have a property matching each column, even if you're not displaying
// any data from the row in that column
fakeData.forEach(row => { row.actions = ''; });
export class PeopleGrid extends React.Component { export class PeopleGrid extends React.Component {
render() { render() {
@@ -14,7 +16,7 @@ export class PeopleGrid extends React.Component {
<div> <div>
<h1>People</h1> <h1>People</h1>
<div id="table-area"> <div id="table-area">
<Griddle results={fakeDataWithAction} <Griddle results={fakeData}
columns={columnMeta.map(x => x.columnName)} columns={columnMeta.map(x => x.columnName)}
columnMetadata={columnMeta} columnMetadata={columnMeta}
resultsPerPage={resultsPerPage} resultsPerPage={resultsPerPage}