Sigma Php Ajax framework, Ajax Components, GUI Builder
May 23, 2012, 02:25:57 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Grid paging bug with using PHP  (Read 1382 times)
ghis
Jr. Member
**
Posts: 6


View Profile
« on: March 14, 2011, 12:28:54 PM »

I've started to use your Sigma Grid and it's nice, I like it. Though I am filling the data with the help of PHP and you seem to have a bug with it.
There is no 'pageSize' property coming from the JSON Object and so the Paging isn't working correctly when changing the 'Display x per page'. Though it's working correctly when using the 'array' property inside the JS script.

Here's some codes that I've took from your PHP examples:
Inside 'Index.php' you set these:


and inside 'Controler.php' you set these:


So it seems that we are missing the 'pageSize' property to be transferred in the JSON Object.
The paging is working correctly as long as I'm not changing the 'Display xx per page', as soon as I change it then it's causing an offset since the 'pageSize' stays the same in the 'Controller.php'
Logged
ghis
Jr. Member
**
Posts: 6


View Profile
« Reply #1 on: April 02, 2011, 10:53:40 PM »

Am I the only one having problems with using the "recordType: Object" and PHP?
Because it looks like even the sort is not working properly, has it only sort for the displayed items and not the complete list. For example, if having 5 pages of data, sorting will only sort on the current page and not the rest of data.

Am I missing something?
Am I the only one having these issues?
Anyone replies would be nice just to know where I stand...

Thanks
Logged
ghis
Jr. Member
**
Posts: 6


View Profile
« Reply #2 on: June 04, 2011, 06:48:45 PM »

Well it seems that there's not much action here, so I had to take a little more look into this.

1st problem (page size) -- FIXED
Found solution, I found the property I needed by looking at the JSON result with Firebug.
So here is the code:



2nd problem (data sorting) -- BUG
Data sorting is still a problem and is most probably a bug with the sigmaGrid itself. When sorting per any column from the top, it only seems to be sorting what's displayed on screen, or sorting by 'Page' if you wish to say it that way. I'm using PHP and recordType is set to 'object' in the property of the grid as mentioned from previous code.
Here's a quick example, let say we have field "No" and the Page Size is set to "5",
Our full data set is this:
1, 2, 3, 4, 5, 8, 10, 12

Since we only display 5 at a time, we will see these on 1st page:
1, 2, 3, 4, 5

when sorting descending, we would expect to have this:
12, 10, 8, 5, 4  <-- GOOD

though in reality it only seems to sort data on screen, so we end up with:
5, 4, 3, 2, 1 <-- WRONG


[The Real Problem]
When Sorting (click any of the field in the grid), it should in theory query again the database though it is not. The Sort only works as per page because the Grid Object only has 1 page loaded in the Object itself.

[Temporary Fix]
This is temporary and is not the best solution, though is prove to work. From the SigmaGrid PHP example, remove the LIMIT portion of the database query, so you will load everything inside the Grid Object, performance wise it will be ugly if you have lot of data, but the sort will work.
Logged
ghis
Jr. Member
**
Posts: 6


View Profile
« Reply #3 on: June 05, 2011, 01:28:05 PM »

Well after consideration, the "Temporary Fix" that I have mentionned isn't working so great. It was working for the Sort but now the Paging is broken. Unless SigmaGrid fix the BUG, it doesn't seem that I have a working grid.

 Shocked
Damn, I just found out that actually SigmaGrid is only Sorting as per page, not per the whole data set. Seriously this isn't the way to go, but that's what they decided, I saw that by testing their online demo, it sorts by page only.  Embarrassed

That would be a nice feature in next version of SigmaGrid then, Sort by complete data set instead of just page.
« Last Edit: June 05, 2011, 01:46:02 PM by ghis » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!