diff --git a/js/components/ascribe_piece_list_toolbar/piece_list_toolbar.js b/js/components/ascribe_piece_list_toolbar/piece_list_toolbar.js new file mode 100644 index 00000000..d2597ed1 --- /dev/null +++ b/js/components/ascribe_piece_list_toolbar/piece_list_toolbar.js @@ -0,0 +1,56 @@ +import React from 'react'; + +import PieceListStore from '../../stores/piece_list_store'; +import PieceListActions from '../../actions/piece_list_actions'; + +import Input from 'react-bootstrap/lib/Input'; +import Glyphicon from 'react-bootstrap/lib/Glyphicon'; +import Button from 'react-bootstrap/lib/Button'; + +let PieceListToolbar = React.createClass({ + + getInitialState() { + return PieceListStore.getState(); + }, + + onChange(state) { + this.setState(state); + }, + + componentDidMount() { + PieceListStore.listen(this.onChange); + }, + + componentDidUnmount() { + PieceListStore.unlisten(this.onChange); + }, + + searchFor() { + let searchTerm = this.refs.search.getInputDOMNode().value; + PieceListActions.fetchPieceList(this.state.page, this.pageSize, searchTerm, this.state.orderBy, this.state.orderAsc); + }, + + render() { + let searchIcon = ; + + return ( +
+
+
+
+
+ +    + +
+
+
+
+
+ ); + } +}); + +export default PieceListToolbar; \ No newline at end of file diff --git a/js/components/piece_list.js b/js/components/piece_list.js index 2a75b7da..ea1ef790 100644 --- a/js/components/piece_list.js +++ b/js/components/piece_list.js @@ -11,6 +11,7 @@ import AccordionListItemTableEditions from './ascribe_accordion_list/accordion_l import Pagination from './ascribe_pagination/pagination'; import PieceListBulkModal from './ascribe_piece_list_bulk_modal/piece_list_bulk_modal'; +import PieceListToolbar from './ascribe_piece_list_toolbar/piece_list_toolbar'; let PieceList = React.createClass({ @@ -50,6 +51,7 @@ let PieceList = React.createClass({ return (
+