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

angularjs - How can i add the serial number to rows in Angular ui gird

问题描述:

I am using this for my angular grid

http://ui-grid.info/

and i want to add serial numbers to all rows.

I tried this

{name: 'ID', field: '', displayName: 'Row Number', cellTemplate: '<div>{{row.rowIndex + 1}}</div>'},

But it keep showing on 1 in the column. Lool like row.rowIndex is not giving returning anything.

How can i fix that. Thanks

网友答案:

I was very much on to hacking ui-grid found that interpolation of 'rowRenderIndex' solved for me.

use

 <span>{{rowRenderIndex+1}}</span>

for serial numbers in ui-grid

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