klwillis
Posts: 428
|
Posted: 07/22/2004, 10:23 AM |
|
I have a page 'PeopleList.php' which contains
a grid list 'PeopleGridList'.
When moving from page to page within the grid,
the URL looks something like this ...
PeopleList.php?PeopleGridListPage=n; where
n is the page of records within the grid to view.
'PeopleGridListPage' gets sent as a URL parameter
(when the page navigator links are clicked) to display
the current page of records within the grid.
If records are deleted by another user in the system, then
it is possible that there will no longer be records for a grid page.
If page three can no longer be viewed (because a user deleted
records for this page), then the following URL will result in
0 records being shown:
PeopleList.php?PeopleGridListPage=3
Is there a way to detect this and view the first page of records
in the grid?
Comments are appreciated.
_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"
Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006 |
|
|
Last Hero
|
Posted: 07/23/2004, 1:55 AM |
|
In AfterExecuteSelect events try to analizing $gridname->ds->RecordsCount and ($gridname->PageNumber * $gridname->PageSize).
If first value < second, and $gridname->PageNumber >1 make redirect to this page with parameter gridnamepage = ($gridname->PageNumber -1)
Hint: use CCGetQueryString for creating correct redirect with sorters data
|
|
|
klwillis
Posts: 428
|
Posted: 07/23/2004, 2:25 PM |
|
I'll give that a try. Thanks. :)
_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"
Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006 |
|
|
klwillis
Posts: 428
|
Posted: 07/23/2004, 4:41 PM |
|
Quote Last Hero:
In AfterExecuteSelect events try to analizing $gridname->ds->RecordsCount and ($gridname->PageNumber * $gridname->PageSize).
If first value < second, and $gridname->PageNumber >1 make redirect to this page with parameter gridnamepage = ($gridname->PageNumber -1)
Hint: use CCGetQueryString for creating correct redirect with sorters data
Ooops ... the 'PageSize' property is not effected by record deletions.
There must be another way to dynamically check the number of
records displayed per page.
The 'RecordsCount' property returns the entire number of records,
not just those for the currently displayed page.
This is interesting.
_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"
Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006 |
|
|
Last Hero
|
Posted: 07/26/2004, 12:54 AM |
|
You know RecordsCount, You know PageNumber and PageSize
please make some calculation and yo know what count of record you have on current page :)
|
|
|
Last Hero
|
Posted: 07/26/2004, 6:45 AM |
|
Another way:
In BeforeShowRow count rows
|
|
|
klwillis
Posts: 428
|
Posted: 08/01/2004, 8:22 PM |
|
Quote Last Hero:
Another way:
In BeforeShowRow count rows
Have you tried this? It doesn't seem to work.
Do you mean actually counting each time the event is called?
I guess that would work, but I thought there might be a better way.
_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"
Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006 |
|
|
Last Hero
|
Posted: 08/03/2004, 12:43 AM |
|
in BeforeShowRow event:
global $counter;
$counter++;
Thats all :)
|
|
|