angular-ui/ui-grid

uigrid rows not rendered

Open

#5,073 创建于 2016年2月6日

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

描述

I have this same issue that has been mentioned before where there are rows in the grids data collection but they aren't rendered. They are rendered SOMETIMES, but not always. If I hit refresh on the browser MOST of the time the rows are NOT displayed. I tried some of the mentioned fixes: adding ui-grid-auto-resize="". In one post it was recommended to:

"put a binding on your page (in the html) to {{ defaultValues }}, directly above the grid."

and I was able to display the name for the row that should have been in the table. in addition to setting a breakpoint and seeing (at least at that point the grid data variable had at least 1 row.

It seems related to loading cellTemplates from an external file (at least for me). When I replaced cellTemplate: 'app/components/profile/profileCompanyActionsTemplate.html' with (this is same html that is in the file):

<div style="padding: 5px 10px; float:right;"><a style="padding:0 10px;" title="Skills" class="btn-small" ng-click="grid.appScope.showSkills(row.entity, row)"><span class="glyphicon glyphicon-wrench"></span></a><a style="padding:0 10px;" title="Attributes" class="btn-small" ng-click="grid.appScope.showAttributes(row.entity, row)"><span class="glyphicon glyphicon-list"></span></a><a style="padding:0 10px;" title="Delete" class="btn-small" ng-click="grid.appScope.delete(row.entity, row)"><span style="color:red;" class="glyphicon glyphicon-trash"></span></a></div>

it works (every time).

for now I'm using the inline method, but would like to know what I'm doing wrong when trying to use the html file approach.

Thanks

贡献者指南