Jump to content


Photo

NxDBHTMLColumn


  • Please log in to reply
1 reply to this topic

#1 Afiag

Afiag
  • Members
  • 117 posts

Posted 22 July 2010 - 03:00 AM

Hey Berg,

Currently I'm trying to add a payment column for each record in my grid using paypal. As I have no clue really how to do this, I for now tried this route:

1. Add a NxDBHTMLColumn to my DBGrid.
2. In my online SQL Database add a "text" field called "buy" and add the following html code in this field for a test row:
CODE
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="QEB7DG5EKFPBG">
<input type="image" src="btn_cart_SM.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="pixel.gif" width="1" height="1">

3. Link the NxDBHTMLColumn's fieldname to the "Buy" field in the online SQL database.

But this results in the word "memo" being displayed in every row on my DBGrid. I'm probably way off on how I am trying to achieve my goal here.... which is adding a paypal add to cart button to every row on my DBGrid. Which of course should be clickable and execute the html code as listed above. Biggest problem seems to be the limitation on paypal's end that their checkout procedures only work using a button using html code. I guess it would have been easier if I could just add a standard delphi code button to my dbgrid and have that linked to paypal but that doesn't seem possible sad.gif it needs to use the html form code to generate the button that provides a valid link when clicked upon.


EDIT: It just occured to me, I *could* just add a "buy" image to every row in a imagecolumn that when clicked opens a sort of popupwindow that exists out of a TWebbrowser that "links" to a website that has something along the lines:

"
Are you sure you want to add "ItemX" to your cart ?
<paypal add to cart button here>
"

and then when the user clicks the "add to cart button" on the popup window it would run as html and add it to my paypal cart ..... this is however an extra step that while it should work, I'd like to avoid and have the button straight in my dbgrid to eliminate this step ..

#2 Boki (Berg)

Boki (Berg)

    Boki (Berg)

  • Forum Admin
  • PipPipPipPipPip
  • 8,191 posts
  • Gender:Male

Posted 04 August 2010 - 11:31 PM

Hello Afiag,

Please sorry for such a huge delay, I was missed this topic.

Unfortunately you can't render complex html code in column.

Also, for displaying MEMO fields you must use MemoColumn.

I suggest that you separate appearance in more columns. If you want I may help you with ideas.

Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users