datadoit.com
|
| Posted: 06/08/2005, 10:12 AM |
|
PHP4; CCS 2.3
How can I get the current page number that an editable grid is on?
My goal is to use the Submit button to submit the data and go to the next
grid page.
|
|
|
 |
datadoit.com
|
| Posted: 06/08/2005, 10:47 AM |
|
"datadoit.com" <mike@datadoit.com> wrote in message
news:d878te$irf$1@news.codecharge.com...
> PHP4; CCS 2.3
>
> How can I get the current page number that an editable grid is on?
>
> My goal is to use the Submit button to submit the data and go to the next
> grid page.
>
>
Also need the TotalPages or NumberPages. I've found how to get the page
number: $Grid->PageNumber. But $Grid->TotalPages or $Grid->NumberPages
don't work.
|
|
|
 |
peterr
Posts: 5971
|
| Posted: 06/08/2005, 10:50 AM |
|
You can navigate through pages and check which part of the URL changes.
In our online example at http://examples.codecharge.com/ExamplePack/NavRecordGrid/NavRecordGrid.php I can see that it is "employeesPage".
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
datadoit.com
|
| Posted: 06/08/2005, 11:13 AM |
|
Here's some of what I'm thinking when the grid is submitted:
global $FileName;
global $Redirect;
$pg = CCRemoveParam(CCGetQueryString("QueryString", ""), "QuestionPage");
// remove what's there.
$pg = CCRemoveParam(CCGetQueryString("QueryString", ""), "ccsForm");
// whatever this thing is.
if ($Question->PageNumber != $Question->TotalPages) {
$pg = CCAddParam($pg, "QuestionPage", $Question->PageNumber + 1);
}
else {
$pg = CCAddParam($pg, "QuestionPage", $Question->PageNumber);
}
$Redirect = $FileName."?". $pg;
------------------------
It'd be nice if TotalPages really worked, but it doesn't. How can I get the
total number of pages in the grid?
|
|
|
 |
DonB
|
| Posted: 06/08/2005, 2:07 PM |
|
The total number of pages is available from the datasource for your grid:
MyGrid->ds->PageCount().
To see it in use, you can put a label on a page and assign it the "Action"
for "Retrieve number of pages". Then look at what this adds to your event
code.
--
DonB
http://www.gotodon.com/ccbth
"datadoit.com" <mike@datadoit.com> wrote in message
news:d87avv$kl6$1@news.codecharge.com...
> "datadoit.com" <mike@datadoit.com> wrote in message
>news:d878te$irf$1@news.codecharge.com...
> > PHP4; CCS 2.3
> >
> > How can I get the current page number that an editable grid is on?
> >
> > My goal is to use the Submit button to submit the data and go to the
next
> > grid page.
> >
> >
>
> Also need the TotalPages or NumberPages. I've found how to get the page
> number: $Grid->PageNumber. But $Grid->TotalPages or $Grid->NumberPages
> don't work.
>
>
|
|
|
 |
|