CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Tips & Solutions

 Editable Grid - Add Empty Rows or Change Page Size

Print topic Send  topic

Author Message
DonB
Posted: 12/19/2005, 5:09 PM

There's some code floating around to implement an "Add Row" capability in
the Editable Grid. It's mainly some javascript, but requires some
hand-edits to the html template page, soo.

In response to a query about changing the default pagesize in the 'wishes'
forum, I realized there could be a much simple way to add blank rows to an
Editable Grid. I suggest setting the Empty Rows parameter to zero, then
add the following to the grid's Before Select event:

$myGrid->EmptyRows = CCGetParam("add", $myGrid->EmptyRows); # PHP

myGrid.EmptyRows = CCGetParam("add", myGrid.EmptyRows); ' ASP

What this does is cause the grid to display as many blank rows as you need,
specified by the number you put into the 'add' URL parameter (e.g., ?a=3).

The one significant difference between my approach and the example code, is
that mine will submit whatever existing rows might be in the grid, then
reload the grid with the desired number of blanks rows. The other one
predefines several blank rows but keeps them hid until you ask to display
them using some javascript, thus you can begin to edit a row, click 'add'
and get some more blanks.
.
The same thing can be done with the 'PageSize' property, to dynamically
change the number of non-empty' rows the grid displays.
--
DonB

http://www.gotodon.com/ccbth


DonB
Posted: 12/19/2005, 5:20 PM

Uh, actually - my version will NOT submit the rows in the grid (so, if you
have an edit begun, you need to save that before the add is requested). It
would be fairly easy to add a second Submit button, and in the On Click
event, append the 'add' parameter to your querystring, so that the submit
saves, then reloads the page with extra empty rows.

Ans I should mention that by 'add' I meant a Link control whose href points
to itself and includes the parameter 'add=1' (for example).

--
DonB

http://www.gotodon.com/ccbth


Benjamin Krajmalnik
Posted: 12/19/2005, 6:42 PM

Don,

Check my reply to your suggestion.
The embed for the PageSize was at the AfterPageInitialize.
BeforeSelect of BeforeShow was too late in the code sequence for it to take
effect, since the code had already run and established the number of rows to
retrieve.

DonB
Posted: 12/20/2005, 4:53 AM

I don't see any problem - works just fine for me. What version of CCS for
you? I used my example code in 2.3. The grid Before Select runs before the
rows are determined, which is why I used that particular event (vs a 'page'
event).

--
DonB

http://www.gotodon.com/ccbth


"Benjamin Krajmalnik" <kraj@illumen.com> wrote in message
news:do7r2n$u4f$1@news.codecharge.com...
> Don,
>
> Check my reply to your suggestion.
> The embed for the PageSize was at the AfterPageInitialize.
> BeforeSelect of BeforeShow was too late in the code sequence for it to
take
> effect, since the code had already run and established the number of rows
to
> retrieve.
>
>

Benjamin Krajmalnik
Posted: 12/21/2005, 8:21 PM

2.3 as well, but it did not work.
Go figure.
In any case, at the page event it worked fine.

"DonB" <~ccbth~@gotodon.com> wrote in message
news:do8us8$h05$1@news.codecharge.com...
> I don't see any problem - works just fine for me. What version of CCS for
> you? I used my example code in 2.3. The grid Before Select runs before
the
> rows are determined, which is why I used that particular event (vs a
'page'
> event).
>
> --
> DonB
>
> http://www.gotodon.com/ccbth
>
>
> "Benjamin Krajmalnik" <kraj@illumen.com> wrote in message
>news:do7r2n$u4f$1@news.codecharge.com...
> > Don,
> >
> > Check my reply to your suggestion.
> > The embed for the PageSize was at the AfterPageInitialize.
> > BeforeSelect of BeforeShow was too late in the code sequence for it to
> take
> > effect, since the code had already run and established the number of
rows
> to
> > retrieve.
> >
> >
>
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.