Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Merge pull request #4750 from darkdh/4741
Browse files Browse the repository at this point in the history
Fix global table indexing
  • Loading branch information
bsclifton authored Oct 13, 2016
2 parents 689b48b + 00f7026 commit 6c04eaf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions js/components/sortableTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ class SortableTable extends ImmutableComponent {
entry.className = entry.className.replace(' selected', '')
const tableID = entry.id
const index = entry.rowIndex - 1
const globalIndex = parseInt(entry.getAttribute('data-global-index'))
const handlerInput = this.props.totalRowObjects
? (typeof this.props.totalRowObjects[parseInt(tableID)][index].toJS === 'function'
? this.props.totalRowObjects[parseInt(tableID)][index].toJS()
: this.props.totalRowObjects[parseInt(tableID)][index])
? (typeof this.props.totalRowObjects[parseInt(tableID)][globalIndex].toJS === 'function'
? this.props.totalRowObjects[parseInt(tableID)][globalIndex].toJS()
: this.props.totalRowObjects[parseInt(tableID)][globalIndex])
: (this.props.rowObjects.size > 0 || this.props.rowObjects.length > 0)
? (typeof this.props.rowObjects.toJS === 'function'
? this.props.rowObjects.get(index).toJS()
Expand Down Expand Up @@ -212,6 +213,7 @@ class SortableTable extends ImmutableComponent {
? <tr {...rowAttributes}
data-context-menu-disable={rowAttributes.onContextMenu ? true : undefined}
id={this.props.tableID}
data-global-index={i}
className={
(this.hasRowClassNames
? this.props.rowClassNames[i] + ' ' + rowAttributes.className
Expand Down

0 comments on commit 6c04eaf

Please sign in to comment.