angular-ui/ui-grid

Dynamic columnDefs not working

Open

#4,502 opened on Oct 9, 2015

View on GitHub
 (0 comments) (0 reactions) (0 assignees)JavaScript (5,395 stars) (2,496 forks)batch import
help wantedneeds: analysis

Description

I am using the ui-grid v3.0.7 - 2015-10-06 and angular v1.4.7 I have tried many permutations to this and nothing seems to work. I have a table with about 25 columns. The first 4 are consistent in name and field from data. the other 21 are dynamic in field name. The current way, also not working looks like the following taken from (http://stackoverflow.com/questions/19630273/dynamic-columndef-in-ng-grid)

$scope.MyGridOptions = { ... columnDefs:'MyColumns', ... }

I then do a $scope.MyGridOptions .push({ ... }) for all 25 columns and then apply the data by $scope.MyGridOptions .data = jsonData.PeriodValues;

The header row does not show, nor do any of the rows. It "seems" as if the columns are not using the latest value once I get them from the DB. Is there some way I can force a refresh or something?

Contributor guide