easyui分页选中问题

在使用easyui的datagrid进行分页时,为确保在翻页后保持之前页面的选中数据,只需在datagrid配置中添加idField属性。

easyui跨页选中

当easyui datagrid中有分页时,选中当前页后再翻页,保证上一页选中数据不丢失,只需要在datagrid中添加idField即可。

$('#user_table').datagrid({
    fit: true,
    fitColumns: true,
    striped: true,
    nowrap: true,
    border: false,
    remoteSort: false,
    collapsible: true,
    url: '?c=Auth/User&a=userinfoJsondataManage',
    queryParams:{
        type:"{$search['key_word']}",
        key:"{$search['key_value']}"
    },
    frozenColumns: [[
        {field: 'ck', checkbox: true}
    ]],
    columns: [[
        {field: 'userName', title: '账号名称', align: 'left', resizable: true, width: 100, editor: 'text'},
        {field: 'userDescription', title: '描述', align: 'left', resizable: true, width: 100, editor: 'text'},
        {field: 'userGroup', title: '所属父组', align: 'left', resizable: true, width: 100, editor: 'text'},
        {field: 'userInvalid', title: '状态', align: 'left', resizable: true, width: 100, editor: 'text'},
    ]],
    loadMsg: '请等待,数据正在加载......',
    toolbar: '#tb',
    idField: 'userName',
    pageSize: 20,
    pageList: [20,50,100],
    pagination: true,
    onCheck: setToolBar,
    onUncheck: setToolBar,
    onClickRow: setToolBar,
    onCheckAll: setToolBar,
    onUncheckAll: setToolBar,
    onSelect: setToolBar,
    onUnselect: setToolBar                  
});
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值