From de418bbbb42567d24f8b26a390bb9a9dbb711084 Mon Sep 17 00:00:00 2001 From: Dan Lewi Harkestad Date: Mon, 7 Sep 2015 14:34:51 +0200 Subject: [PATCH] GridInstance.scrollTo takes an object in the data array as parameter, not a GridRow. Also, both parameters are optional. See https://github.com/angular-ui/ui-grid/blob/a42dab24532fb896725b9fc8359e4526e436c891/src/js/core/factories/Grid.js#L2419-L2440 --- ui-grid/ui-grid-tests.ts | 6 ++++++ ui-grid/ui-grid.d.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ui-grid/ui-grid-tests.ts b/ui-grid/ui-grid-tests.ts index 485f7d378..4eedf8675 100644 --- a/ui-grid/ui-grid-tests.ts +++ b/ui-grid/ui-grid-tests.ts @@ -100,5 +100,11 @@ gridApi.core.queueGridRefresh() gridApi.core.queueRefresh(); gridApi.core.registerColumnsProcessor(colProcessor, 100); +var rowEntityToScrollTo = {anObject: "inGridOptionsData"}; +var columnDefToScrollTo: uiGrid.IColumnDef; +gridInstance.scrollTo(); +gridInstance.scrollTo(rowEntityToScrollTo); +gridInstance.scrollTo(rowEntityToScrollTo, columnDefToScrollTo); + var selectedRowEntities: Array = gridApi.selection.getSelectedRows(); var selectedGridRows: Array = gridApi.selection.getSelectedGridRows(); diff --git a/ui-grid/ui-grid.d.ts b/ui-grid/ui-grid.d.ts index 38a7aadbf..f9371fc5c 100644 --- a/ui-grid/ui-grid.d.ts +++ b/ui-grid/ui-grid.d.ts @@ -445,7 +445,7 @@ declare module uiGrid { * @param {IColumnDef} colDef to make visible * @returns {ng.IPromise} a promise that is resolved after any scrolling is finished */ - scrollTo(rowEntity: IGridRow, colDef: IColumnDef): ng.IPromise; + scrollTo(rowEntity?: any, colDef?: IColumnDef): ng.IPromise; /** * Scrolls the grid to make a certain row and column combo visible, * in the case that it is not completely visible on the screen already.