EasyUI Forum

General Category => Bug Report => Topic started by: Stefan B. on May 08, 2014, 02:43:22 AM



Title: Bug with datagrid methode getPager
Post by: Stefan B. on May 08, 2014, 02:43:22 AM
Since Version 1.3 we can set the pagePosition on datagrid. This defines the position of the pager bar. When i set pagePosition='both' the pagination is shown on top and bottom. That's working.

But when I add user defined buttons to the pageination like the following code, the buttons are only on the pagination at the datagrid bottom!
This looks like a bug.

Code:
var pager = $('#dg').datagrid('getPager');
pager.pagination({ // get the pager of datagrid
  buttons: $('#custommerButtons')
});

<div id="custommerButtons"> 
    <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" ><%=lang.get("tbNew")%></a> 
    <a href="#" class="easyui-linkbutton" iconCls="icon-save" plain="true" ><%=lang.get("tbSave")%></a>
    <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" ><%=lang.get("tbDelete")%></a> 
    <a href="#" class="easyui-linkbutton" iconCls="icon-cancel" plain="true"><%=lang.get("tbCancel")%></a> 
</div>


Title: Re: Bug with datagrid methode getPager
Post by: stworthy on May 08, 2014, 07:45:25 AM
Please try the code below to solve your issue.
Code:
var pager = $('#dg').datagrid('getPager');
pager.each(function(){
$(this).pagination({
buttons: $('#custommerButtons').clone()
})
})


Title: Re: Bug with datagrid methode getPager
Post by: Stefan B. on May 09, 2014, 06:51:35 AM
Hello. That works fine.

Please try the code below to solve your issue.
Code:
var pager = $('#dg').datagrid('getPager');
pager.each(function(){
$(this).pagination({
buttons: $('#custommerButtons').clone()
})
})


If I use extra configuration array it's works also
Code:
	$('#dg').datagrid('getPager').pagination({
    buttons:[{
        iconCls:'icon-add',
        text: 'tbNew',
        handler:function(){
        }
    },{
        iconCls:'icon-edit',
        text: 'tbEdit',
        handler:function(){
        }
    }]
    });