fix step 1

This commit is contained in:
Tim Daubenschütz 2015-05-21 14:03:56 +02:00
parent 9506cf3b1b
commit 14728af9f1
3 changed files with 13 additions and 5 deletions

View File

@ -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} />

View File

@ -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-';

View File

@ -0,0 +1,9 @@
import React from 'react';
let TableHeaderItem = React.createClass({
mixins: [TableColumnMixin],
render() {
return()
}
});