EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: akashana on November 15, 2019, 04:53:17 AM



Title: Combogrid Hide Pagination in Scrollview & also changing form data variable
Post by: akashana on November 15, 2019, 04:53:17 AM
Hi,

I have 2 questions

1. Combogrid with load-on-demand works perfectly. We want to hide the pagination row and therefore, we set pagination=false, but then data is not being loaded.  How can we achieve that ?

2. When we scroll, the URL is called with form data with variables rows & page. Is it possible to change form data variables  from rows to rowNo and page to pageNo ? we have few api that accept rowNo & pageNo as parameters.


Code:
			$('#tt').combogrid({
panelWidth:800,
method: 'POST',
url: 'ourUrl',
idField:'id',
textField:'text',
fitColumns:true,
view:scrollview,
multiple: true,
mode:'remote',
fitColumns:true,
pagination:true,
pageSize: 50,
columns:[[
{field:'id',title:'ID',width:80},                     
{field:'text',title:'Name',width:80,align:'left'},
]],
loadFilter: function (data) {                       
    return {
        total: data.TotalRecords,
        rows: data.Data,
    }
},
                });

Thanks,


Title: Re: Combogrid Hide Pagination in Scrollview & also changing form data variable
Post by: jarry on November 15, 2019, 06:56:57 PM
Call 'getPager' method on the datagrid to get the pagination object and hide it.
Code:
$('#cg').combogrid({
    pagination:true,
    onBeforeLoad: function(param){
        param.rowNo = param.rows;
        param.pageNo = param.page;
    }
})
var grid = $('#cg').combogrid('grid');
grid.datagrid('getPager').hide()