EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Darrel on January 13, 2016, 10:05:35 PM



Title: pageSize Textbox in Datagrod pagination [Solved]
Post by: Darrel 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.


Title: Re: pageSize Textbox in Datagrod pagination
Post by: stworthy 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');
    }
})


Title: Re: pageSize Textbox in Datagrod pagination
Post by: Darrel on January 14, 2016, 03:20:20 AM
Thanks a lot stworty. It works great :)

Thanks :)