angular-ui/ui-grid

columnWidth not correctly computed if table initialized hidden

Open

#6,090 创建于 2017年3月17日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)JavaScript (5,395 star) (2,496 fork)batch import
good first issueworkaround

描述

brief desc:
condition: width is not fixed px but %, result: columnWidth not correctly computed if table initialized hidden and then click somewhere to show it steps:

  1. html like this: <div ng-show='table.show'><div ui-grid='table.option' style="width: 100%"></div></div> <a ng-click='table.click()'></a>

2 .js $scope.table={ show: false, option:{ .... }, click:function(){this.show = true} }

  1. result: columnWidth value is NaN so that all the width defined in columnDefs doesn't work, the table css looks not correct, and api.core.refresh() doesn't make things work right.
  2. if the initial value of table.show is true, everything works fine.

贡献者指南