CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 adding a button to each row of a Grid to be able to delete

Print topic Send  topic

Author Message
aradi

Posts: 66
Posted: 02/25/2004, 5:47 AM

I used the Grid builder to show records in a table , i am trying to modify the Grid to display a button in each row in the Grid , to allow me to delete any row i want without leaving the same page. Any guidance



Thanks in advance
View profile  Send private message
DonB
Posted: 02/26/2004, 7:19 AM

Add a Server On Click event to the button. In that code include the
following line:

connection.Execute ("DELETE FROM table WHERE primarykey=" &
primarykeycolumn.value)

You have to fix that up to use the actual connection name, primarykey name
and primarykeycolumn that you defined in your application.

Basically, you select the primarykey of the table out of your grid and
construct a delete statement.

I would have used the Editable Grid and taken advantage of it's "Delete"
checkbox feature.
--
DonB

http://www.gotodon.com/ccbth


"aradi" <aradi@forum.codecharge> wrote in message
news:5403ca758e90ac@news.codecharge.com...
> I used the Grid builder to show records in a table , i am trying to modify
the Grid to display a button in each row in the Grid , to allow me to
delete any row i want without leaving the same page. Any guidance
>
>
>
> Thanks in advance
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

DonB
Posted: 02/26/2004, 7:20 AM

Oops, wrong language:

$db->query("DELETE FROM table WHERE primarykey=" .
primarykeycolumn->GetValue());


--
DonB

http://www.gotodon.com/ccbth


"DonB" <~ccbth~@gotodon.com> wrote in message
news:c1l2pi$a5o$1@news.codecharge.com...
> Add a Server On Click event to the button. In that code include the
> following line:
>
> connection.Execute ("DELETE FROM table WHERE primarykey=" &
> primarykeycolumn.value)
>
> You have to fix that up to use the actual connection name, primarykey name
> and primarykeycolumn that you defined in your application.
>
> Basically, you select the primarykey of the table out of your grid and
> construct a delete statement.
>
> I would have used the Editable Grid and taken advantage of it's "Delete"
> checkbox feature.
> --
> DonB
>
> http://www.gotodon.com/ccbth
>
>
> "aradi" <aradi@forum.codecharge> wrote in message
>news:5403ca758e90ac@news.codecharge.com...
> > I used the Grid builder to show records in a table , i am trying to
modify
> the Grid to display a button in each row in the Grid , to allow me to
> delete any row i want without leaving the same page. Any guidance
> >
> >
> >
> > Thanks in advance
> > ---------------------------------------
> > Sent from YesSoftware forum
> > http://forums.codecharge.com/
> >
>
>

aradi

Posts: 66
Posted: 02/26/2004, 8:58 AM

Greate, Thanks a lot , i will try both methods
View profile  Send private message
aradi

Posts: 66
Posted: 03/01/2004, 9:23 AM

Hello DonB,

The Editable Grid worked fine for me , but when i tried the other solution by addeing a button(to each row) to a non Editable Grid with the Server OnClick event , it did not work. After i publish tthe page , the button does not do any thing. Is there some thing i am doing wrong.
View profile  Send private message
DonB
Posted: 03/01/2004, 10:20 AM

The non-editable grid does not contain a <form> in the html, therefore there
is no action to perform in the browser when you click it (the button). This
is why I mentioned the Editable Grid, because it does have a <form> and the
corresponding "post" action that goes back to the server. Thus, the Ed Grid
can generate the server on click event and the regular grid cannot.

In theory, I supposed you could code a <form> onto the page with the regular
grid - sort of a "dummy" form that doesn't do anything itself, really. Then
you could put a client-side onclick() event into the button and have it
submit that form. This is not a very good idea from the standpoint of
future maintenance (somebody will be wondering what the heck you were
thinking when you wrote it). And I don't know for a fact it will really
work as I haven't tried it.

It is important to understand the separation of client from server, the
functionality of both, and the way data is moved back and forth between them
in a web application. While not apparent (normally), the server is
oblivious to the fact there is a client browser out there, except when the
client sends information back to the server (via GET or POST actions). So
you have to perform client-side actions that notify the server "something
happened".

--
DonB

http://www.gotodon.com/ccbth


"aradi" <aradi@forum.codecharge> wrote in message
news:54043718643174@news.codecharge.com...
> Hello DonB,
>
> The Editable Grid worked fine for me , but when i tried the other
solution by addeing a button(to each row) to a non Editable Grid with the
Server OnClick event , it did not work. After i publish tthe page , the
button does not do any thing. Is there some thing i am doing wrong.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>

aradi

Posts: 66
Posted: 03/01/2004, 1:17 PM

Thanks DonB , i realy appreciate your insight
View profile  Send private message

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.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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