jqGrid colModel 绑定数据中显示图片字段的方法


jqGrid colModel 绑定数据中显示图片字段的方法:

$("#jqGrid").jqGrid({
        url: '请求数据的接口',
        datatype: "json",
        mtype: "POST",
        colModel: [
            {label: '', name: 'id', width: 50},
            {label: '创建时间', name: 'createTime', width: 50},
            {
                //列表中显示图片
                label: '图片', name: 'picUrl', width: 50, formatter: function (cellvalue) {
                    return '<img src="' + cellvalue + '" style="width: 100%;height: 100%" />';
                }
            }
        ],
        viewrecords: true,
        height: 385,
        rowNum: 10,
        rowList: [10, 30, 50],
        rownumbers: true,
        rownumWidth: 25,
        autowidth: true,
        multiselect: true,
        pager: "#jqGridPager",
        jsonReader: {
            root: "page.list",
            page: "page.currPage",
            total: "page.totalPage",
            records: "page.totalCount"
        },
        prmNames: {
            page: "page",
            rows: "limit",
            order: "order"
        },
        gridComplete: function () {
            //隐藏grid底部滚动条
            $("#jqGrid").closest(".ui-jqgrid-bdiv").css({"overflow-x": "hidden"});
            vm.GetAdPlace();
        }
    });

相关阅读 >>

jqGrid colmodel 绑定数据中显示图片字段的方法

更多相关阅读请进入《jqGrid》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...