EasyUI Forum

General Category => Bug Report => Topic started by: mazvv on August 16, 2014, 10:49:17 AM



Title: Datagrid pageNumber bug
Post by: mazvv 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.


Title: Re: Datagrid pageNumber bug
Post by: jarry 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.


Title: Re: Datagrid pageNumber bug
Post by: mazvv 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>


Title: Re: Datagrid pageNumber bug
Post by: jarry 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/


Title: Re: Datagrid pageNumber bug
Post by: mazvv 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


Title: Re: Datagrid pageNumber bug
Post by: jarry on August 17, 2014, 05:39:09 AM
Yes, it is the normal behavior.