Datagrid - reference an image in a column that's stored in a database

Peter Haworth pete at lcsql.com
Wed May 22 22:46:37 EDT 2013


Hi Shawn,
The Datagrid manual has examples of how to customize a column, you can find
it at http://lessons.runrev.com/m/datagrid

There isn't an exact example of what you want to do but It will get you
started with how to customize a column to contain an image (or any other
type of control), and also how to customize the FillInData handler.

Once you've figured that out, the code to set the image from the link is
pretty easy, something like (not tested)

put URL ("binfile:" && <the link>) into tData
set the text of <yourimage> to tData

Pete
lcSQL Software <http://www.lcsql.com>


On Wed, May 22, 2013 at 6:49 PM, Shawn Blc <shawnlivecode at gmail.com> wrote:

> Thanks Pete, could you give me a short example or pass me on a link where I
> can see a short example?
>
>
> On Wed, May 22, 2013 at 8:37 PM, Peter Haworth <pete at lcsql.com> wrote:
>
> > I think you could:
> >
> > - customize the ColPic column to contain an image (any image, even an
> empty
> > one)
> > - edit the FillInData handler of the ColPic column to use the link to
> > binary read the image into a variable and set the text of your image to
> the
> > variable.
> >
> > There could be problems if your images are of different dimensions.
> >
> > Pete
> > lcSQL Software <http://www.lcsql.com>
> >
> >
> > On Wed, May 22, 2013 at 5:29 PM, Shawn Blc <shawnlivecode at gmail.com>
> > wrote:
> >
> > > I have a datagrid.  Using a MySQL database.  In one field of the
> database
> > > I'm storing the image link
> > > example:
> > http://forums.runrev.com/styles/prosilver/imageset/site_logo.gif
> > >
> > > How do I go about showing that image in a column of my datagrid?  For
> > > instance if I have a column called colPic how would I show the above
> > > reference image?
> > >
> > > Been stumped on this for hours.
> > > _______________________________________________
> > > use-livecode mailing list
> > > use-livecode at lists.runrev.com
> > > Please visit this url to subscribe, unsubscribe and manage your
> > > subscription preferences:
> > > http://lists.runrev.com/mailman/listinfo/use-livecode
> > >
> > _______________________________________________
> > use-livecode mailing list
> > use-livecode at lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>



More information about the use-livecode mailing list