EasyUI Forum
September 14, 2025, 12:46:39 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 a button to pagination at runtime  (Read 6040 times)
Stefan B.
Full Member
***
Posts: 152


Software Architekt


View Profile Email
« on: June 17, 2014, 02:37:01 AM »

How can I add a button to pagination at runtime?
If I use the following code the buttons on the pagination not changed (not view the new buttons).
It looks like the refresh not working for the buttons?

Code:
		pager = $('#'+eDatagridSelector).edatagrid('getPager');
var btns= pager.pagination('options').buttons;
btns.push(newButtonArray);
$('#'+eDatagridSelector).edatagrid('getPager').pagination('refresh', {
buttons: btns
});
Logged
Stefan B.
Full Member
***
Posts: 152


Software Architekt


View Profile Email
« Reply #1 on: June 17, 2014, 04:46:35 AM »

I found selfthe solution that's working

Code:
	function _addButtons(eDatagridSelector, buttons) {
//get old buttons and change them
var edg = $('#'+eDatagridSelector);
var currentPagerButtons = edg.datagrid('getPager').pagination('options').buttons;
for (var i = 0; i < buttons.length; i++) {
currentPagerButtons.push(buttons[i]);
}

//set buttons with new buttons
edg.datagrid('getPager').pagination({ buttons: currentPagerButtons });
}
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!