Skip to content

Instantly share code, notes, and snippets.

@gregturn
Created August 17, 2015 17:15
Show Gist options
  • Select an option

  • Save gregturn/730dd9f96ca2dc1067b4 to your computer and use it in GitHub Desktop.

Select an option

Save gregturn/730dd9f96ca2dc1067b4 to your computer and use it in GitHub Desktop.
render: function () {
var employees = this.props.employees.map(employee =>
<Employee key={employee._links.self.href}
headers={response.headers}
employee={response.entity}
attributes={this.props.attributes}
onUpdate={this.props.onUpdate}
onDelete={this.props.onDelete}/>
)
);
var navLinks = [];
if ("first" in this.props.links) {
navLinks.push(<button key="first" onClick={this.handleNavFirst}>&lt;&lt;</button>);
}
if ("prev" in this.props.links) {
navLinks.push(<button key="prev" onClick={this.handleNavPrev}>&lt;</button>);
}
if ("next" in this.props.links) {
navLinks.push(<button key="next" onClick={this.handleNavNext}>&gt;</button>);
}
if ("last" in this.props.links) {
navLinks.push(<button key="last" onClick={this.handleNavLast}>&gt;&gt;</button>);
}
return (
<div>
<input ref="pageSize" defaultValue={this.props.pageSize} onInput={this.handleInput}/>
<table>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Description</th>
<th></th>
</tr>
{employees}
</table>
<div>
{navLinks}
</div>
</div>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment