How to get row index in angular ui-grid 3.0

后端 未结 6 724
执念已碎
执念已碎 2020-12-31 10:32

I\'m working with angular ui-grid version 3.0 and can not find the way to get the index of the row, to add a numeration column to the grid. I would like to help me.

6条回答
  •  天命终不由人
    2020-12-31 11:31

    Use rowRenderIndex in your cell template, it is the native variable available on each row

    E.g

    columnDefs: [
              {
                enableFiltering: false,
                enableSorting: false,
                field: "sn",
                displayName: "Sn#",
                cellTemplate:
                  "
    {{rowRenderIndex}} s
    " } ]

提交回复
热议问题