easyui datagrid 动态修改查询参数

页面载入时获取所有数据:

 tabCodeItem.datagrid({
        url: "/List",
        idField: 'id',
        pagination: true,
        pageSize: 30,
        queryParams: { },
        rownumbers: true,
        singleSelect: true,
        striped: true,
        fit: true,
        border: false,
       ...

    var p = tabCodeItem.datagrid('getPager');
    (p).pagination({
        beforePageText: '第',//页数文本框前显示的汉字
        afterPageText: '页    共 {pages} 页',
        displayMsg: '共{total}条数据'

    });

查询后获取符合条件的数据:

function srhCodeItem() {
    dlgSrhCodeItem.dialog('close');
    var classId = srhCodeItemClass.combobox('getValue');
    var key = srhCodeItemKey.textbox('getValue');
    var para = {};
    if (classId != '') {
        para.classId = classId;
    }
    if (key != '') {
        para.key = key;
    }

    tabCodeItem.datagrid('options').queryParams = para;
    tabCodeItem.datagrid('reload');
}

你可能感兴趣的:(jquery,easyui)