jqGrid 改变url参数之后重新加载无效

这个问题就是jqGrid本身的缓存机制导致的,要每次初始化之前先清除一下!

表格初始化时加上

 $('#jqGrid3').jqGrid('clearGridData');
    $('#jqGrid3').jqGrid('setGridParam', {url: baseURL + 'member/userbaseinfo/pointList/'+memberId}).trigger('reloadGrid');
/**
 * 积分表
 */
function pointList(memberId) {
    $('#jqGrid3').jqGrid('clearGridData');
    $('#jqGrid3').jqGrid('setGridParam', {
        url: baseURL + 'member/userbaseinfo/pointList/'+memberId,
        postData:{
             key:"value",
            'username': vm.q.username
        }
    }).trigger('reloadGrid');
    $("#jqGrid3").jqGrid({
        url: baseURL + 'member/userbaseinfo/pointList/'+memberId,
        datatype: "json",
        colModel: [
            { label: '添加时间', name: 'addtime', index: 'addtime', width: 150, align: 'center'  },
            { label: '业务摘要', name: 'remark', index: 'remark', width: 70, align: 'center'  },
            { label: '出入积分', name: 'changePoint', index: 'change_point', width: 70},
            { label: '当前积分', name: 'point', index: 'point', width: 70, align: 'center'  },
            { label: '备注', name: 'reason', index: 'reason', width: 70, align: 'center'  },
            { label: '支付单号', name: 'paymentId', index: 'payment_id', width: 170, align: 'center'},
            { label: '充值推荐码', name: 'mempayCode', index: 'mempay_code', width: 140, align: 'center'  },
            { label: '操作管理员', name: 'operator', index: 'operator', width: 150, align: 'center'  },
        ],
        caption:"积分",
        viewrecords: true,
        height: 150,
        rowNum: 5,
        rowList : [5,50,100],
        rownumbers: true,
        rownumWidth: 25,
        autowidth:true,
        multiselect: false,
        pager: "#jqGridPager3",
        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" });
        }
    });
}

 

阅读更多
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页