tanjiannan 2012-11-14 15:31
浏览 279
已采纳

easyUI 重构 分页条参数问题

 

<table id="dg" title="My Users" class="easyui-datagrid" style="width:700px;height:250px" 
            url="http://localhost:8080/s2sh_framework/json/user/list" 
            toolbar="#toolbar" pagination="true" 
            rownumbers="true" fitColumns="true" singleSelect="true"> 
        <thead> 
            <tr> 
                <th field="username" width="50">用户名</th> 
                <th field="truename" width="50">真名</th>
                <th field="email" width="50">邮箱</th> 
            </tr> 
        </thead> 
    </table> 
    <div id="toolbar"> 
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="newUser()">New User</a> 
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editUser()">Edit User</a> 
        <a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="destroyUser()">Remove User</a> 
    </div>

 

点击下一页 post请求[page第几页 , rows一页多少条数据],那我现在不想带这两个参数,我想修改参数为page是pageNo,也想修改rows为pageSize,不知道可以不?

为什么我要修改rows呢?因为post请求给服务端的参数rows 和 响应返回的参数rows 同名了,我想修改之

 

 

  • 写回答

3条回答 默认 最新

  • iteye_4938 2012-11-15 09:25
    关注

    我用的是版本是1.2.6,在jquery.easyui.min.js大概9215行(查看之前先将js格式化),找到[code="java"]function _4ea(_4eb, _4ec) {
    var opts = $.data(_4eb, "datagrid").options;
    if (_4ec) {
    opts.queryParams = _4ec;
    }
    var _4ed = $.extend({}, opts.queryParams);
    if (opts.pagination) {
    $.extend(_4ed, {
    page : opts.pageNumber,
    rows : opts.pageSize
    });
    }
    if (opts.sortName) {
    $.extend(_4ed, {
    sort : opts.sortName,
    order : opts.sortOrder
    });
    }
    if (opts.onBeforeLoad.call(_4eb, _4ed) == false) {
    return;
    }
    $(_4eb).datagrid("loading");
    setTimeout(function() {
    _4ee();
    }, 0);
    function _4ee() {
    var _4ef = opts.loader.call(_4eb, _4ed, function(data) {
    setTimeout(function() {
    $(_4eb).datagrid("loaded");
    }, 0);
    _481(_4eb, data);
    setTimeout(function() {
    _4de(_4eb);
    }, 0);
    }, function() {
    setTimeout(function() {
    $(_4eb).datagrid("loaded");
    }, 0);
    opts.onLoadError.apply(_4eb, arguments);
    });
    if (_4ef == false) {
    $(_4eb).datagrid("loaded");
    }
    };
    };[/code]
    将[code="java"]page : opts.pageNumber,
    rows : opts.pageSize[/code]替换成你想要的参数名称

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型