EasyUI Forum
May 16, 2024, 06:23:38 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: How can I add default user buttons to the pagination  (Read 6338 times)
Stefan B.
Full Member
***
Posts: 152


Software Architekt


View Profile Email
« on: January 16, 2014, 06:49:30 AM »

How can I add default user buttons to the pagination like this:

Code:
$.fn.pagination.defaults = $.extend({}, $.fn.pagination.defaults, {
loading: true,
beforePageText: paginationPageLabel,
afterPageText: paginationPageOfLabel +" {pages}",
displayMsg: paginationFooterMsg,

buttons:[{
          iconCls:'icon-add',
          text: 'add',
          handler:function(){
        //code by Option?
  }
        },{
          iconCls:'icon-save',
          text: 'save',
          handler:function(){
        //code by Option?
  }
        },{
          iconCls:'icon-remove',
          text: 'remove,
          handler:function(){
        //code by Option?
  }
        },{
           iconCls:'icon-cancel',
           text: 'cancel',
          handler:function(){
        //code by Option?
  }
        }]

});

and can I disable buttons with user options set on special pages like this:

Code:
	$('#edServerServerRel').datagrid('getPager').pagination({ // get the pager of datagrid
            disableAddButton: true,
            cancelHandlerCode: 'jsMethodeXyz'
});
« Last Edit: January 16, 2014, 06:55:20 AM by Stefan B. » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: January 16, 2014, 07:09:54 PM »

Extending $.fn.pagination.defaults will apply to all the pagination components. If you wish to add some buttons to a datagrid pager bar, attaching from some existing elements may be more flexible.
Code:
<div id="tt">
<a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true"></a>
<a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true"></a>
<a href="#" class="easyui-linkbutton" iconCls="icon-save" plain="true"></a>
<a href="#" class="easyui-linkbutton" iconCls="icon-cut" plain="true"></a>
<a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true"></a>
</div>

$(function(){
$('#dg').datagrid('getPager').pagination({
buttons:$('#tt')
});
});
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!