问题描述:

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

相关阅读:
Top