From 44c2b28f4bc89ed2d9063955c09f7e0114b72224 Mon Sep 17 00:00:00 2001 From: Tomasz Lewinski Date: Sun, 18 Dec 2016 19:16:01 +0100 Subject: [PATCH 1/2] Now you can disable multiSorting --- iron-data-table.html | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/iron-data-table.html b/iron-data-table.html index a4466af..dce37ec 100644 --- a/iron-data-table.html +++ b/iron-data-table.html @@ -328,6 +328,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 + }, + /** * Number of items fetched at a time from the datasource. */ @@ -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 From 58b04d0a9181e24667229ca97e3a9e3fd41e87ae Mon Sep 17 00:00:00 2001 From: Tomasz Lewinski Date: Sun, 18 Dec 2016 19:22:21 +0100 Subject: [PATCH 2/2] moved param definition in better place --- iron-data-table.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/iron-data-table.html b/iron-data-table.html index dce37ec..a3a1f47 100644 --- a/iron-data-table.html +++ b/iron-data-table.html @@ -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 */ @@ -328,15 +337,6 @@ 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 - }, - /** * Number of items fetched at a time from the datasource. */