EasyUI Forum
April 29, 2024, 09:31:32 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Data grid paging remote loading false ?  (Read 23546 times)
yogesh
Newbie
*
Posts: 47


View Profile Email
« on: November 08, 2012, 04:23:57 AM »

Hi,

I check the data grid paging demo even i tried my own code working fine with remote data.

but i observed that paging code is supporting remote data only

if i have JSON data with 1000 rows which i am loading first time in datagrid and i want pagination
how will it work?
i don't want to call server every time.
for sorting we are providing remotesort ture/false option, is there any postion for remotepaging ?

i didn't found this in documentation.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: November 08, 2012, 06:04:47 AM »

To enable client paging, the loader of datagrid should be redefined. Using buffer view is another good choice.
Logged
yogesh
Newbie
*
Posts: 47


View Profile Email
« Reply #2 on: November 08, 2012, 06:33:41 AM »

sorry again asking in details

i didn't found  property client paging in document

can you provide code ?

i saw  buffer view its good but i will like to go with paging Smiley
Logged
Punkerr
Newbie
*
Posts: 37


View Profile
« Reply #3 on: November 08, 2012, 06:48:19 AM »

Check my code in this post: http://www.jeasyui.com/forum/index.php?topic=850.0
Logged
yogesh
Newbie
*
Posts: 47


View Profile Email
« Reply #4 on: November 08, 2012, 07:17:45 AM »

sorry Punkerr  not getting i check code

i want code for local paging or client pagin

my current code is

Code:
  $('#searchResultGrid').datagrid({
             title: 'Deviation Search Result',
             iconCls: 'icon-save',
             width: width1,             
             height: height1,
             nowrap: true,
             autoRowHeight: false,
             striped: true,
             collapsible: true,
             sortName: 'ID',
             sortOrder: 'desc',
             remoteSort: false,
             idField: 'Id',
             frozenColumns: [[
                { field: 'Id', checkbox: true },
                { title: 'ID', field: 'ID', width: 80, sortable: true }
]],
         
columns: [[{ field: 'DeviationId', title: 'DeviationId', width: 180, align: 'Left', formatter: function(value) {
    return '<span style="font-weight:normal;">' + value + '</span>';
}
},
                { field: 'TestNumber', title: 'TestNumber', width: 180, align: 'Left', formatter: function(value) {
                    return '<span style="font-weight:normal;">' + value + '</span>';
                }
                },
                   { field: 'Activity', title: 'Activity', width: 60, align: 'Left', formatter: function(value) {
                       return '<span style="font-weight:normal;">' + value + '</span>';
                   }
                   }

                ]],
             pagination: true,
             loader: function(param, success, error) {
                 setDeviationSearchDataSearchData();
                 loadDeviationSearchData();
             }
             });



search result is 48 rows all 48 rows are coming on the 1st page  and pagesize is 10  if i move on 2nd page it still showing 48 rows with page number 2
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #5 on: November 08, 2012, 06:55:18 PM »

Please refer to the sample below, which implement the client side pagination functionality.
http://www.jeasyui.com/demo/main/index.php?plugin=DataGrid&theme=default&dir=ltr&pitem=Client%20Side%20Pagination
Logged
yogesh
Newbie
*
Posts: 47


View Profile Email
« Reply #6 on: November 09, 2012, 05:54:03 AM »

thank you Smiley

but there is mistake in the demo code
Code:
   datadata.rows = data.originalRows.slice(start, end);  

it may be
Code:
   data.rows = data.originalRows.slice(start, end);   
Logged
yogesh
Newbie
*
Posts: 47


View Profile Email
« Reply #7 on: November 09, 2012, 06:21:24 AM »

Hi stworthy

can you check the post http://www.jeasyui.com/forum/index.php?topic=864.0

how to maintain the selected checkbox on the pagination
Logged
dtucker
Newbie
*
Posts: 11


View Profile Email
« Reply #8 on: November 04, 2013, 03:59:49 PM »

I still can't get this to work. Can you see if I'm missing something. I tried following the example but it is not working. It is failing at ".splice == 'function'" because I'm returning json data. My grid populates just not paging correctly.

Code:
$('#dgMostVisitedPages').datagrid({
                  url: 'MostVisitedPages/MostVisitedPages.php?orgid='+ _selectedOrganization,
                  pagination:'true',
                  singleSelect:'true',
                  striped:'true',
                  fitColumns:'true'
                 
              });

Code:
<table id="dgServiceCategory" title="Service Categories" class="easyui-datagrid" toolbar="#toolbarServiceCategory" singleSelect="true">
<thead>
<tr>
<th data-options="field:'categoryid',width:80" hidden="true">ID</th>
<th data-options="field:'category',width:50" >Category</th>
</tr>
</thead>
</table>
<div id="toolbarServiceCategory">
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="AddServiceCategory()">New Category</a>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="EditServiceCategory()">Edit Category</a>
<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="DeleteServiceCategory()">Remove Category</a>
</div>

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