Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions iron-data-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,15 @@
value: false
},

/**
* When `false`, items may be sorted by many collumns at once.
* When `true`, items may be sorted only by one collumn.
*/
disableMultiSort: {
type: Boolean,
value: false
},

/**
* An array containing path/filter value pairs that are used to filter the items
*/
Expand Down Expand Up @@ -650,6 +659,18 @@
}
}

// disable multiSorting
if(this.disableMultiSort && this.sortOrder.length) {
// clear currently selected column
this.set('sortOrder.0.direction', null);

this.set('sortOrder', [{
path: e.detail.path,
direction: e.detail.direction
}]);
return;
}

this.push('sortOrder', {
path: e.detail.path,
direction: e.detail.direction
Expand Down