EasyUI Forum
September 14, 2025, 03:08:59 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: Datagrid pageNumber bug  (Read 13958 times)
mazvv
Newbie
*
Posts: 20


View Profile WWW
« on: August 16, 2014, 10:49:17 AM »

Hi.
Seems there is a bug in datagrid in 1.4. The initial value of pageNumber is 0 by default for empty datagrid instead 1.
« Last Edit: August 16, 2014, 10:55:32 AM by mazvv » Logged

TravelCRM - opensource CRM for travel companies
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #1 on: August 16, 2014, 04:21:07 PM »

Please download the patch from http://www.jeasyui.com/download/downloads/jquery-easyui-1.4-patch.zip to solve this issue.
Logged
mazvv
Newbie
*
Posts: 20


View Profile WWW
« Reply #2 on: August 17, 2014, 01:01:55 AM »

Please download the patch from http://www.jeasyui.com/download/downloads/jquery-easyui-1.4-patch.zip to solve this issue.
Does not work correctly, default page num stays 0. My code is
Code:
    <table class="easyui-datagrid"
    id="${_id}"
        data-options="
            url:'${request.resource_url(_context, 'list')}',border:false,
            pagination:true,fit:true,pageSize:50,singleSelect:true,
            rownumbers:true,sortName:'id',sortOrder:'desc',
            pageList:[50,100,500],idField:'_id',checkOnSelect:false,
            selectOnCheck:false,toolbar:'#${_tb_id}',
            view: detailview,
            onExpandRow: function(index, row){
                var row_id = 'row-${_id}-' + row.id;
                $('#' + row_id).load(
                    '/suppliers/details?id=' + row.id,
                    function(){
                        $('#${_id}').datagrid('fixDetailRowHeight', index);
                        $('#${_id}').datagrid('fixRowHeight', index);
                    }
                );
            },
            detailFormatter: function(index, row){
                var row_id = 'row-${_id}-' + row.id;
                return '<div id=' + row_id + '></div>';
            },         
            onBeforeLoad: function(param){
                $.each($('#${_s_id}, #${_tb_id} .searchbar').find('input'), function(i, el){
                    param[$(el).attr('name')] = $(el).val();
                });
            }
        " width="100%">
        <thead>
            % if _context.has_permision('delete'):
            <th data-options="field:'_id',checkbox:true">${_(u"id")}</th>
            % endif
            <th data-options="field:'id',sortable:true,width:60">${_(u"id")}</th>
            <th data-options="field:'name',sortable:true,width:200">${_(u"name")}</th>
            <th data-options="field:'modifydt',sortable:true,width:120,styler:function(){return datagrid_resource_cell_styler();}"><strong>${_(u"updated")}</strong></th>
            <th data-options="field:'modifier',width:100,styler:function(){return datagrid_resource_cell_styler();}"><strong>${_(u"modifier")}</strong></th>
        </thead>
    </table>
Logged

TravelCRM - opensource CRM for travel companies
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #3 on: August 17, 2014, 03:22:22 AM »

If no data displays in datagrid, the pagination bar will display "Page 0 of 0", just like this example http://jsfiddle.net/6apxbjLq/
Logged
mazvv
Newbie
*
Posts: 20


View Profile WWW
« Reply #4 on: August 17, 2014, 04:08:36 AM »

If no data displays in datagrid, the pagination bar will display "Page 0 of 0", just like this example http://jsfiddle.net/6apxbjLq/
But is this right behavior? There was 1 in previous version
Logged

TravelCRM - opensource CRM for travel companies
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #5 on: August 17, 2014, 05:39:09 AM »

Yes, it is the normal behavior.
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!