EditableCellTemplate ui-grid

时间:2016-09-25 15:16:03

标签: css angularjs angular-ui-grid ui-grid

我想在ui-grid的其中一列中输入类型编号的ng-input。理想情况下它看起来像这样: enter image description here

我使用常规 cellTemplate 来完成此操作,但据我所知,正确的方法是使用 editableCellTemplate 。使用 {{ 1}} 我得到了正确的行为,但我的单元格只能在双击时看起来可编辑,结果如下所示: enter image description here

点击的单元格看起来是可编辑的,休息不是,这不是真正用户友好的。 如何使列中的所有单元格看起来都在 editableCellTemplate 中定义,即使它们未被点击过。

1 个答案:

答案 0 :(得分:1)

您应该指定cellTemplate(除editableCellTemplate之外),以了解值不在焦点时的显示方式。例如......

 { name: 'MyColumn', displayName: 'My column', width: '12%', cellTemplate: 'yourDisplayCellTemplate', editableCellTemplate: 'yourEditableCellTemplate' },