Skip to content

Commit

Permalink
Fixed #730 - Incorrect column sortable prop type definition
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Jan 9, 2019
1 parent 6a49274 commit 6c3942c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/datatable/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ export class DataTable extends Component {
sortSingle(data, sortField, sortOrder) {
let value = [...data];

if(this.columnSortable && this.columnSortable === 'custom' && this.columnSortFunction) {
if(this.columnSortable && this.columnSortFunction) {
value = this.columnSortFunction({
field: this.getSortField(),
order: this.getSortOrder()
Expand Down
4 changes: 2 additions & 2 deletions src/showcase/datatable/DataTableDemo.js
Original file line number Diff line number Diff line change
Expand Up @@ -683,12 +683,12 @@ multiSortMeta.push({field: 'brand', order: -1});
`}
</CodeHighlight>

<p>To customize sorting algorithm, set sortable option to custom and define a sortFunction that sorts the list.</p>
<p>To customize sorting algorithm, define a sortFunction that sorts the list.</p>
<CodeHighlight className="language-jsx">
{`
<DataTable value={this.state.cars} >
<Column field="vin" header="Vin" sortable={true}/>
<Column field="year" header="Year" sortable="custom" sortFunction={this.mysort}/>
<Column field="year" header="Year" sortable={true} sortFunction={this.mysort}/>
<Column field="brand" header="Brand" sortable={true}/>
<Column field="color" header="Color" sortable={true}/>
</DataTable>
Expand Down

0 comments on commit 6c3942c

Please sign in to comment.