Adding URL's to a column's results

Adding URL's to a column's results

orangeorange Posts: 20Questions: 0Answers: 0
edited February 2010 in General
I'm pulling data from json and I'd like to wrap values in a particular column in value456. with "value456" being copied and pasted into the url.

for example:

my table looks like so:

[code]

link
www.yahoo.com
description

[/code]

but i'd like to be able to produce:
[code]

link
www.yahoo.com
description

[/code]

with the being generated from it's corresponding value.

any ideas? i can alter the json, too, if that helps. it is setup in the datatables way, currently. sTitles for the first object and the values for the following objects.

thanks,
orange

Replies

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    Hi orange,

    Two quick options:

    1. Just have whatever is creating the JSON put the HTML in place for you (you can have HTML in the JSON).

    2. If this isn't an option, or you don't like it, use fnRender:
    http://datatables.net/usage/columns#fnRender
    http://datatables.net/examples/advanced_init/column_render.html

    Allan
  • orangeorange Posts: 20Questions: 0Answers: 0
    Yes, fnRender should do it. Thank you.
This discussion has been closed.