当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - UI-Grid 3.0 how to show/hide button in a column cell for first row

问题描述:

I know it's bad to reference other questions but since I cannot comment on this guys page, the best I can do is post his question here and ask, here is his link:

ng-grid how to show/hide button in a column cell for last row

Now the question I have is how would I apply this concept but instead only hide the action button on the first row. I have a delete button on all my rows but I cannot hide the delete button on the first row only. I've even tried ng-hide="row.rowIndex==0" assuming the index value of zero would hide the delete button but it doesn't.

UPDATE:

I have answer below. I figured out that ui grid 3.0 doesn't really have index values but if you apply what I have below into cellTemplate you can render index values for the rows and manipulate the rows to hide/show what you want.

cellTemplate: '<div ng-hide{{grid.renderContainers.body.visibleRowCache.indexOf(row)}}==0"><a class="sidePadding" title="Delete"><span class="glyphicon glyphicon-trash text-danger cursorHover"></span></a></div>'

网友答案:

Figured it out ng-hide="{{grid.renderContainers.body.visibleRowCache.indexO‌​f(row)}}==0", it works perfectly now! :)

分享给朋友:
您可能感兴趣的文章:
随机阅读: