EasyUI Forum
April 30, 2024, 06:32:30 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: Datagrid totals seem inconsistent with records displayed  (Read 10439 times)
peter900
Newbie
*
Posts: 22


View Profile Email
« on: September 09, 2016, 09:22:18 AM »


The screen shot below shows a datagrid with records 41 - 82 displayed ( with vertical scrolling ) yet the paging control at the bottom says Displaying 41 to 60 of 193 items   The 193 total is correct but why is the record range incorrect ?  Thanks.

https://www.dropbox.com/s/qns5zokjp3rji2t/eui09092016a.png?dl=0
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: September 10, 2016, 02:52:05 AM »

Please look at this example http://code.reloado.com/alecay/edit#preview. It works fine.
Logged
peter900
Newbie
*
Posts: 22


View Profile Email
« Reply #2 on: September 13, 2016, 12:12:19 AM »

Thanks Jarry.  Sorry but I wasn't suggesting a code problem - like your example I have grids that display the correct totals.  Perhaps you or someone could look at the json which is driving the grid with the problems. It validates fine and I cannot see any issues.

https://www.dropbox.com/s/sweb527qme3xt4i/euiforumjson1.txt?dl=0

Thanks.
Logged
iklotzko
Newbie
*
Posts: 15


View Profile Email
« Reply #3 on: September 13, 2016, 06:40:10 AM »

Peter,

I noticed in your data the "Id" field is null in many--if not all--cases: this should be populated. Also, make sure you specify a value for the "idField", in your case it would read " idField: 'Id', ... "


If that doesn't solve your problems, can you please post relevant code AND post the request header you use to get the data shown.
Logged
peter900
Newbie
*
Posts: 22


View Profile Email
« Reply #4 on: September 14, 2016, 02:07:16 AM »

Thanks iklotzko - I'll look at filling the id field and then providing the identifier of the unique field in the JSON - like....

{"total":193,"idField: 'Id',"rows":[{"Id":"e778322rgy7","CreatedDate":"2016-08-28T14:43:45.000Z","Leader__c":".....

Thanks for your help on this.
Logged
iklotzko
Newbie
*
Posts: 15


View Profile Email
« Reply #5 on: September 14, 2016, 01:19:15 PM »

Peter,

No problem! But, it's not in the returned results you want to specify the property: idField: 'Id'

You'll want this in the grid options itself, either through data-options property of your target element
Code:
<table class="easyui-datagrid" data-options="... idField: 'id', url: 'myurl.php'... " ..</table>

or if you use JavaScript to initialize your datagrid
Code:
$('#mygrid').datagrid({
   .
    idField: 'Id',
    url: 'myurl.php',
   .
   .
});

Please tell me if it works for you!
Ira
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #6 on: September 14, 2016, 07:49:42 PM »

This example works fine.
http://code.reloado.com/alecay/2/edit#preview
Logged
iklotzko
Newbie
*
Posts: 15


View Profile Email
« Reply #7 on: September 15, 2016, 09:08:31 AM »

Oh... Peter, are you actually using client side data or fetching from a URL?

I just tried this out in fiddle and the issue here is that it is a bit more complex for client pagination. You should check the examples out in the demo section of easyui.

Server-side pagination is considerably easier and consists mainly of determining which rows to bring back. Look at the examples.
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!