bootstraptable 序号递增

https://www.cnblogs.com/xbq8080/p/8227487.html

columns: [
    {
        title: '序号',
        field: '',
        align: 'center',
        formatter: function (value, row, index) {
            var pageSize = $('#table的id').bootstrapTable('getOptions').pageSize;     //通过table的#id 得到每页多少条
            var pageNumber = $('#table的id').bootstrapTable('getOptions').pageNumber; //通过table的#id 得到当前第几页
            return pageSize * (pageNumber - 1) + index + 1;    // 返回每条的序号: 每页条数 *(当前页 - 1 )+ 序号
        }
    },
    {
        .....
    }
}

猜你喜欢

转载自blog.csdn.net/xinyuebaihe/article/details/88644197