From 26ad8e4b3ed75213515041d1401b3d0fd3f3e881 Mon Sep 17 00:00:00 2001 From: Denis Bendrikov Date: Mon, 27 Feb 2017 20:16:48 +0200 Subject: [PATCH] fix(revert): calculate width's for column headers even if the data is empty #14 --- src/UiGridAutoFitColumnsService.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/UiGridAutoFitColumnsService.ts b/src/UiGridAutoFitColumnsService.ts index 0531f3f..939b8cf 100644 --- a/src/UiGridAutoFitColumnsService.ts +++ b/src/UiGridAutoFitColumnsService.ts @@ -87,6 +87,9 @@ export class UiGridAutoFitColumnsService { } columnsProcessor(renderedColumnsToProcess?: Array, rows?: Array) { + if (!rows.length) { + return renderedColumnsToProcess; + } // TODO: respect existing colDef options // if (col.colDef.enableColumnAutoFitting === false) return;