EasyUI Forum
May 14, 2024, 07:14:26 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Custom Pagination for Datagrid  (Read 7870 times)
BinaryCode
Newbie
*
Posts: 38


View Profile
« on: July 01, 2015, 03:55:52 PM »

Hi,

I have problem custom pagination to custom layout button and add searchbox for datagrid:

First time OK,

Code:
var pager = listVehicle.datagrid('getPager');
        pager.pagination({
            pageSize: 50,
            pageList: [50, 100, 200],
            layout: ['list', 'prev', 'next'],
            buttons: '#buttons',
            displayMsg: '' //{from} to {to} of {total} Data
        });

<div id="buttons">
    <table style="border-spacing:0">
        <tr>
            <td>
                <input class="easyui-searchbox" style="width:150px">
            </td>
            <td>
                <a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-save',plain:true"></a>
            </td>
        </tr>
    </table>
</div>


But..., after call:

Code:
listVehicle.datagrid('loadData', {"total": 0, "rows": []});
    listVehicle.datagrid({
        queryParams: {
            user_id: id
        }
    });

Pagination back to default,

Help me please,

TIA,
« Last Edit: July 01, 2015, 04:00:57 PM by BinaryCode » Logged
jarry
Administrator
Hero Member
*****
Posts: 2264


View Profile Email
« Reply #1 on: July 01, 2015, 05:03:03 PM »

Please notice that calling .datagrid({...}) with a configuration object as the parameter will re-create the datagrid again. You should prevent from doing that. If you just want to set the 'queryParams' property, please try this:
Code:
var opts = listVehicle.datagrid('options');
opts.queryParams = {
  user_id: ...
};
Logged
BinaryCode
Newbie
*
Posts: 38


View Profile
« Reply #2 on: July 01, 2015, 06:17:50 PM »

Hi Jerry,

Great very help me,

TIA
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!