angular-ui/ui-grid

Dynamic columnDefs not working

Open

#4,502 创建于 2015年10月9日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)JavaScript (2,496 fork)batch import
help wantedneeds: analysis

仓库指标

Star
 (5,395 star)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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?

贡献者指南