Merge pull request #24288 from pbojanczyk/master

ui-grid: added defaultSort property to columnDef
This commit is contained in:
Mine Starks
2018-03-20 16:36:13 -07:00
committed by GitHub
2 changed files with 12 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
// Type definitions for ui-grid
// Project: http://www.ui-grid.info/
// Definitions by: Ben Tesser <https://github.com/btesser>, Joe Skeen <https://github.com/joeskeen>
// Definitions by: Ben Tesser <https://github.com/btesser>
// Joe Skeen <https://github.com/joeskeen>
// Peter Bojanczyk <https://github.com/pbojanczyk>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -3545,6 +3547,8 @@ declare namespace uiGrid {
export interface IGridColumnOf<TEntity> {
/** Column definition */
colDef: uiGrid.IColumnDefOf<TEntity>;
/** 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 +3687,8 @@ declare namespace uiGrid {
* @default false
*/
cellTooltip?: boolean | string | ICellTooltipGetter<TEntity>;
/** 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.

View File

@@ -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;