PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Structures_DataGrid posting images... (help wanted badly )

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Structures
View previous topic :: View next topic  
Author Message
mononoke102



Joined: 06 Aug 2008
Posts: 6

PostPosted: Fri Aug 08, 2008 4:47 pm    Post subject: Structures_DataGrid posting images... (help wanted badly ) Reply with quote

Hi, I am new to PEAR, and I am confused... I want to post image files to the column of the datagrid. I have successfully installed Structures_DataGrid and the grid is showing with no problem with paging and sorting working. I tried to look for some tutorial by google search and found following site: http://www.samalyse.com/code/pear/linked_grids/ still not clear...

What I want is: like ebay grid, show the thumbnail image of the products and descriptions in the next column. I also want to put hyperlink to the image.

If there is any other tutorial that explains how, it would be GREAT!

Thanks
Sad Sad Sad Sad
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1013

PostPosted: Fri Aug 08, 2008 5:05 pm    Post subject: Reply with quote

You need to use column formatters for this task. The explanation can be found here:
http://pear.php.net/manual/en/package.structures.structures-datagrid.formatter.php

If you need more details, don't hesitate to ask.
Back to top
View user's profile Send private message
mononoke102



Joined: 06 Aug 2008
Posts: 6

PostPosted: Sun Aug 10, 2008 8:53 pm    Post subject: Hi Mark. Reply with quote

Hi, Mark!

Thank you very much for the reply. I want to store thumbnail image into gridview. I am getting my data from array into my grid. Could you please suggest me how I can accomplish this?

Thank you.

Mayumi
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1013

PostPosted: Sun Aug 10, 2008 10:13 pm    Post subject: Re: Hi Mark. Reply with quote

mononoke102 wrote:
Thank you very much for the reply. I want to store thumbnail image into gridview. I am getting my data from array into my grid. Could you please suggest me how I can accomplish this?


As I wrote, a column formatter is the solution. Add a column with a column formatter for the image, just like it is shown in the manual for the first column (using the "printLink" formatter). In the example a link is generated ("<a href="...">...</a>"), but the idea is the same for images.
Back to top
View user's profile Send private message
mononoke102



Joined: 06 Aug 2008
Posts: 6

PostPosted: Mon Aug 11, 2008 3:44 pm    Post subject: Hi Mark! Reply with quote

It worked Shocked !!!!!! Thank you very much! Very Happy

I have another question, If I want to put css tags to each rows in the table what should I do? Is there way to assign tags to tables?

Thank you very much for your kind cooperations.

Sincerely,

Mayumi Twisted Evil
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1013

PostPosted: Mon Aug 11, 2008 10:48 pm    Post subject: Re: Hi Mark! Reply with quote

mononoke102 wrote:
I have another question, If I want to put css tags to each rows in the table what should I do? Is there way to assign tags to tables?


An example for adding CSS styles/classes can be found here:
http://pear.php.net/manual/en/package.structures.structures-datagrid.example-advanced.php

All options of the HTML_Table render of SDG are documented here:
http://pear.php.net/manual/en/package.structures.structures-datagrid.structures-datagrid-renderer.htmltable.php

$renderer->getContainer(); ($renderer = $datagrid->getRenderer();) or $datagrid->fill($table); give you access to the HTML_Table object for full flexibility:
http://pear.php.net/package/Structures_DataGrid/docs/latest/Structures_DataGrid/Structures_DataGrid_Renderer.html#methodgetContainer
http://pear.php.net/manual/en/package.structures.structures-datagrid.structures-datagrid.getrenderer.php
http://pear.php.net/manual/en/package.structures.structures-datagrid.structures-datagrid.fill.php
Back to top
View user's profile Send private message
mononoke102



Joined: 06 Aug 2008
Posts: 6

PostPosted: Tue Aug 12, 2008 9:51 pm    Post subject: Re: Hi Mark! Reply with quote

Thanks!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Structures All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software