bootstrap table 服务端

//初始化用户列表
    $("#usergroud").bootstrapTable({
        method: 'post',
        url: '/Wx_UserGroup/GetUserInfo',
        cache: false,
        height: 600,
        striped: true,
        pagination: true,
        pageSize: 20,
        pageList: [20, 40, 60, 80, 200],
        search: false,
        showColumns: false,
        showRefresh: false,
        minimumCountColumns: 2,
        clickToSelect: false,
        sidePagination: "server",
        dataType: "jsonp",
        //dataType: "json",
        queryParams: function (e) {
            var param = {
                PageSize: e.limit,
                PageIndex: (e.offset / e.limit) + 1,
              
            };
            return param;
        },
        responseHandler: function (e) {
           
            if (e.data && e.data.Rows && e.data.Rows.length > 0) {
                return { rows: e.data.Rows, total: e.data.Total };
            }
            else {
                return { "rows": [], "total": 0 };
            }
        },
        columns: [{
            field: 'Id',
            checkbox: true,
            visible: true
        },
        {
            field: 'pic',
            title: '头像',
            align: 'center',
            sortable: true,
            clickToSelect: false,
            formatter: imageFormatter
        },
        {
            field: 'name',
            title: '姓名',
            align: 'center',
            sortable: true,
            clickToSelect: false
        },
        {
            field: 'sex',
            title: '性别',
            align: 'center',
            sortable: true,
            clickToSelect: false,
            formatter: sexFormatter
        },
        {
            field: 'addr',
            title: '地址',
            align: 'center',
            sortable: true,
            clickToSelect: false
        },
         {
             field: 'group',
             title: '分组',
             align: 'center',
             clickToSelect: false
             //events: operateEvents
         }]
    }).on('page-change.bs.table', function (e, size, number) {
        //console.log(size, number)
    });




});

function imageFormatter(value, row, index) {
    return "";
}
function sexFormatter(value, row, index) {
    return value == 1 ? "男" : "女";
}


你可能感兴趣的:(bootstrap,table)