From 0c1189250fa1e845e24b43f35f4f69ccdbd20d00 Mon Sep 17 00:00:00 2001 From: Adam Gordon Date: Mon, 13 Jun 2016 09:45:53 -0600 Subject: [PATCH] fix(ui-grid): fix isRowSelectable typing (#9594) * per [the ui-grid documentation](http://ui-grid.info/docs/#/tutorial/210_selection), `isRowSelectable` is a function that returns a boolean, rather than a straight boolean property. --- ui-grid/ui-grid-tests.ts | 6 ++++-- ui-grid/ui-grid.d.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ui-grid/ui-grid-tests.ts b/ui-grid/ui-grid-tests.ts index 0f34b031ee..7d91d94748 100644 --- a/ui-grid/ui-grid-tests.ts +++ b/ui-grid/ui-grid-tests.ts @@ -111,7 +111,7 @@ gridApi.core.clearAllFilters(true); gridApi.core.addToGridMenu(gridInstance, [menuItem]); gridApi.core.getVisibleRows(gridInstance); gridApi.core.handleWindowResize(); -gridApi.core.queueGridRefresh() +gridApi.core.queueGridRefresh(); gridApi.core.queueRefresh(); gridApi.core.registerColumnsProcessor(colProcessor, 100); @@ -122,7 +122,9 @@ var gridOptions: uiGrid.IGridOptionsOf = { console.log(row.entity.name); }) } -} +}; +gridOptions.isRowSelectable = () => true; + interface IAnotherEntity { anObject: string } diff --git a/ui-grid/ui-grid.d.ts b/ui-grid/ui-grid.d.ts index f10c1a8c71..695be8f908 100644 --- a/ui-grid/ui-grid.d.ts +++ b/ui-grid/ui-grid.d.ts @@ -2825,7 +2825,7 @@ declare namespace uiGrid { * Makes it possible to specify a method that evaluates for each row and sets its "enableSelection" * property. */ - isRowSelectable?: boolean; + isRowSelectable?: (row: IGridRow) => boolean; /** * Enable multiple row selection only when using the ctrlKey or shiftKey. Requires multiSelect to be true. * Defaults to false