mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 09:23:13 +01:00
fix step 1
This commit is contained in:
parent
9506cf3b1b
commit
14728af9f1
@ -10,10 +10,9 @@ let Table = React.createClass({
|
||||
},
|
||||
render() {
|
||||
if(this.props.itemList && this.props.itemList.length > 0) {
|
||||
|
||||
return (
|
||||
<div className="ascribe-table">
|
||||
<TableHeader columnMap={this.props.columnMap} itemList={this.props.itemList} fetchList={this.props.fetchList} orderAsc={this.props.orderAsc} />
|
||||
<TableHeader columnMap={this.props.columnMap} itemList={this.props.itemList} fetchList={this.props.fetchList} orderAsc={this.props.orderAsc} orderBy={this.props.orderBy} />
|
||||
{this.props.itemList.map((item, i) => {
|
||||
return (
|
||||
<TableItem columnMap={this.props.columnMap} columnContent={item} key={i} />
|
||||
|
@ -10,7 +10,8 @@ let TableHeader = React.createClass({
|
||||
columnMap: React.PropTypes.object.isRequired,
|
||||
itemList: React.PropTypes.array.isRequired,
|
||||
fetchList: React.PropTypes.func.isRequired,
|
||||
orderAsc: React.PropTypes.bool.isRequired
|
||||
orderAsc: React.PropTypes.bool.isRequired,
|
||||
orderBy: React.PropTypes.string.isRequired
|
||||
},
|
||||
|
||||
sortIndex(i) {
|
||||
@ -31,9 +32,8 @@ let TableHeader = React.createClass({
|
||||
let columnMapValuesList = GeneralUtils.valuesOfObject(this.props.columnMap);
|
||||
|
||||
let calcHeaderText = (val, i, columnClass) => {
|
||||
let s = "";
|
||||
|
||||
if(columnMapValuesList[i].canBeOrdered) {
|
||||
if(columnMapValuesList[i].canBeOrdered && Object.keys(this.props.columnMap)[i] === this.props.orderBy) {
|
||||
|
||||
let boundClick = this.sortIndex.bind(this, i);
|
||||
let carretDirection = 'glyphicon-triangle-';
|
||||
|
9
js/components/table_header_item.js
Normal file
9
js/components/table_header_item.js
Normal file
@ -0,0 +1,9 @@
|
||||
import React from 'react';
|
||||
|
||||
|
||||
let TableHeaderItem = React.createClass({
|
||||
mixins: [TableColumnMixin],
|
||||
render() {
|
||||
return()
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue
Block a user