From f7bc7b458405b1683029768d1ef4555144aa7be5 Mon Sep 17 00:00:00 2001 From: Peter B Date: Wed, 14 Mar 2018 12:21:38 -0400 Subject: [PATCH 1/3] added defaultSort property to columnDef supporting ui-grid documentation: http://ui-grid.info/docs/#!/tutorial/324_default_sorting --- types/ui-grid/index.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/types/ui-grid/index.d.ts b/types/ui-grid/index.d.ts index 7bf551c59f..274f304dba 100644 --- a/types/ui-grid/index.d.ts +++ b/types/ui-grid/index.d.ts @@ -3545,6 +3545,8 @@ declare namespace uiGrid { export interface IGridColumnOf { /** Column definition */ colDef: uiGrid.IColumnDefOf; + /** Default sort on this column */ + defaultSort?: ISortInfo; /** * Column name that will be shown in the header. * If displayName is not provided then one is generated using the name. @@ -3683,6 +3685,8 @@ declare namespace uiGrid { * @default false */ cellTooltip?: boolean | string | ICellTooltipGetter; + /** Default object of sort information */ + defaultSort?: ISortInfo; /** * Column name that will be shown in the header. * If displayName is not provided then one is generated using the name. From 71aafe57714336c6c5b1b41466baff92e81b2799 Mon Sep 17 00:00:00 2001 From: Peter B Date: Wed, 14 Mar 2018 12:41:21 -0400 Subject: [PATCH 2/3] updated comment to comply with readme.md --- types/ui-grid/index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/types/ui-grid/index.d.ts b/types/ui-grid/index.d.ts index 274f304dba..748dda3bf9 100644 --- a/types/ui-grid/index.d.ts +++ b/types/ui-grid/index.d.ts @@ -1,6 +1,8 @@ // Type definitions for ui-grid // Project: http://www.ui-grid.info/ -// Definitions by: Ben Tesser , Joe Skeen +// Definitions by: Ben Tesser +// Joe Skeen +// Peter Bojanczyk // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 From c4c12dc174a50f7349b99caebdf8343cb8ce8fe9 Mon Sep 17 00:00:00 2001 From: Peter B Date: Mon, 19 Mar 2018 14:18:14 -0400 Subject: [PATCH 3/3] updated test --- types/ui-grid/ui-grid-tests.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/types/ui-grid/ui-grid-tests.ts b/types/ui-grid/ui-grid-tests.ts index 06f18384a5..e1d49a481d 100644 --- a/types/ui-grid/ui-grid-tests.ts +++ b/types/ui-grid/ui-grid-tests.ts @@ -22,6 +22,11 @@ columnDef.cellTooltip = 'blah'; columnDef.cellTooltip = function (gridRow: uiGrid.IGridRow, gridCol: uiGrid.IGridColumn) { return `${gridRow.entity.unknownProperty}-${gridCol.displayName}`; }; +columnDef.defaultSort = { + direction: 'ASC', + ignoreSort: false, + priority: 1 +}; columnDef.displayName = 'Jumper'; columnDef.enableColumnMenu = false; columnDef.enableColumnMenus = false;