pui-react-sortable-table
A React component that provides a table that can be sorted by column
Pivotal UI React (GitHub, npm) is a collection of React components for rapidly building and prototyping UIs.
See the Pivotal UI Styleguide for fully rendered examples.
Components
SortableTable
A table that can be sorted by column
var SortableTable = require('pui-react-sortable-table').SortableTable;
var MyComponent = React.createClass({
render() {
var columns = [
{name: 'c1', title: 'Column 1', sortable: true},
{name: 'c2', title: 'Column 2'}
];
var data = [
{c1: 'yes', c2: 'foo'},
{c1: 'no', c2: 'bar'}
];
return <SortableTable data={data} columns={columns} classes={['my-table']}/>;
}
});
Properties
-
columns
Array<Object>
: A list of column configuration parameters:
name
is the data
key associated with the column;
title
is the header text for the column;
sortable
(defaults to false) indicates whether the table can be sorted by this column; and
align
(defaults to left) sets the text alignment for cells in this column
-
data
Array<Object>
: The data to be displayed in the table
-
classes
Array<String>
: Class names to add to the table
(c) Copyright 2015 Pivotal Software, Inc. All Rights Reserved.