diff --git a/src/app/components/components/data-table/data-table.component.html b/src/app/components/components/data-table/data-table.component.html index 02fee03357..51afe73bfc 100644 --- a/src/app/components/components/data-table/data-table.component.html +++ b/src/app/components/components/data-table/data-table.component.html @@ -15,7 +15,7 @@

with custom headings, columns, and inline editing

comment Comments - {{column.label}} @@ -41,7 +41,7 @@

with custom headings, columns, and inline editing

comment Comments - { {column.label}} @@ -138,10 +138,10 @@

with nested data, formatting, and templates

}) export class Demo { columns: ITdDataTableColumn[] = [ - { name: 'food.name', label: 'Dessert (100g serving)' }, + { name: 'food.name', label: 'Dessert (100g serving)', sortable:true }, { name: 'food.type', label: 'Type' }, - { name: 'calories', label: 'Calories', numeric: true, format: NUMBER_FORMAT }, - { name: 'fat', label: 'Fat (g)', numeric: true, format: DECIMAL_FORMAT }, + { name: 'calories', label: 'Calories', numeric: true, format: NUMBER_FORMAT, sortable:true }, + { name: 'fat', label: 'Fat (g)', numeric: true, format: DECIMAL_FORMAT, sortable:true }, { name: 'carbs', label: 'Carbs (g)', numeric: true, format: NUMBER_FORMAT }, { name: 'protein', label: 'Protein (g)', numeric: true, format: DECIMAL_FORMAT }, { name: 'sodium', label: 'Sodium (mg)', numeric: true, format: NUMBER_FORMAT }, @@ -392,7 +392,7 @@

Example:

{ sku: '1421-0', item: 'Prime Rib', price: 41.15 }, ]; private columns: ITdDataTableColumn[] = [ - { name: 'sku', label: 'SKU #', tooltip: 'Stock Keeping Unit' }, + { name: 'sku', label: 'SKU #', tooltip: 'Stock Keeping Unit', sortable: true }, { name: 'item', label: 'Item name' }, { name: 'price', label 'Price (US$)', numeric: true, format: v => v.toFixed(2) }, ]; diff --git a/src/app/components/components/data-table/data-table.component.ts b/src/app/components/components/data-table/data-table.component.ts index d5e6dd0aff..c07b2e9ff9 100644 --- a/src/app/components/components/data-table/data-table.component.ts +++ b/src/app/components/components/data-table/data-table.component.ts @@ -120,10 +120,10 @@ export class DataTableDemoComponent implements OnInit { }]; columns: ITdDataTableColumn[] = [ - { name: 'name', label: 'Dessert (100g serving)' }, + { name: 'name', label: 'Dessert (100g serving)', sortable: true }, { name: 'type', label: 'Type' }, - { name: 'calories', label: 'Calories', numeric: true, format: NUMBER_FORMAT }, - { name: 'fat', label: 'Fat (g)', numeric: true, format: DECIMAL_FORMAT }, + { name: 'calories', label: 'Calories', numeric: true, format: NUMBER_FORMAT, sortable: true }, + { name: 'fat', label: 'Fat (g)', numeric: true, format: DECIMAL_FORMAT, sortable: true }, { name: 'carbs', label: 'Carbs (g)', numeric: true, format: NUMBER_FORMAT }, { name: 'protein', label: 'Protein (g)', numeric: true, format: DECIMAL_FORMAT }, { name: 'sodium', label: 'Sodium (mg)', numeric: true, format: NUMBER_FORMAT }, diff --git a/src/platform/core/data-table/data-table.component.html b/src/platform/core/data-table/data-table.component.html index 6fe29e886f..baf9157c26 100644 --- a/src/platform/core/data-table/data-table.component.html +++ b/src/platform/core/data-table/data-table.component.html @@ -9,12 +9,12 @@ (click)="selectAll(!checkBoxAll.checked)"> - any; nested?: boolean; + sortable?: boolean; }; export interface ITdDataTableSelectEvent {