EasyUI Forum
December 21, 2025, 02:30:43 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: pageSize Textbox in Datagrod pagination [Solved]  (Read 8930 times)
Darrel
Jr. Member
**
Posts: 74


View Profile
« on: January 13, 2016, 10:05:35 PM »

Hello,

In datagrid using pagination property, is it possible to create a pageSize textbox instead of a dropdown?

I want the page size to be dynamically entered instead of being chosen from the predefined values in the dropdown list.......

Thanks & Regards,
Darrel.
« Last Edit: January 15, 2016, 03:22:19 AM by Darrel » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: January 14, 2016, 12:04:01 AM »

You can't replace the page drop-down but you can append an input box to the pagination bar, please refer to the code below:
Code:
var pager = $('#dg').datagrid('getPager');
var opts = pager.pagination('options');
var list = pager.find('.pagination-page-list').hide();
var tb = $('<input>').insertAfter(list);
tb.numberbox({
    width: 50,
    value: opts.pageSize,
    onChange: function(value){
        list.html('<option>'+value+'<option>');
        pager.pagination('refresh', {pageSize:value});
        list.triggerHandler('change');
    }
})
Logged
Darrel
Jr. Member
**
Posts: 74


View Profile
« Reply #2 on: January 14, 2016, 03:20:20 AM »

Thanks a lot stworty. It works great Smiley

Thanks Smiley
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!