Reactjs 如何使用react js在网格js中显示行索引

Reactjs 如何使用react js在网格js中显示行索引,reactjs,gridjs,Reactjs,Gridjs,当前正在使用reactjs中的grid.js创建我的datatable 这是我的代码 <Grid data={data.filter(e => e.status != 0)} columns={[ { id: 'url', name: 'url', hidden: true }, { id: 'id', name:

当前正在使用reactjs中的grid.js创建我的datatable

这是我的代码

<Grid
    data={data.filter(e => e.status != 0)}
    columns={[
        {
            id: 'url',
            name: 'url',
            hidden: true

        }, {
            id: 'id',
            name: '#',
            formatter: (cell) => _(this.showIndexNo()) //<-- where i do the function to display row index number

        }, {
            id: 'name',
            name: 'Name'
        }, {
            id: 'smgk_name',
            name: 'SM Name',
            formatter: (cell, row) => _(this.showSmlink(row.cells[0].data, row.cells[3].data))

        }, {
            id: 'email',
            name: 'Email',
            // formatter: (cell) => _(moment(cell).format(MOMENT_FORMAT))

        },
        {
            id: 'id',
            name: 'Actions',
            formatter: (cell) => _(this.showButton(cell))
            //(cell) => `Name: ${cell}`
        }
    ]}

    search={true}
    sort={true}
/>
我得到了这个结果:

我不能使用ID作为行索引,因为当我删除一个详细信息时,ID仍然存在,只有状态将更改为已删除(这不会显示在网格中),所以我需要行索引。非常感谢您的帮助

return(subscriberData.filter(e=>e.status!=0).map((项,i)=>
返回{…项,
rowIndex:i//使用rowIndex作为列
}))

}
您好,谢谢您的回复,在这种情况下映射不起作用。。。我只是想知道如何访问rowIndexHi,我把映射放错了位置。它正在工作。。。谢谢:)对不起,呵呵
 showIndexNo() {

 const { subscriberData } = this.state;

 let a = [];

 return (subscriberData.filter(e => e.status != 0).map((item, i) => i ) ) }