dynamic hyperlink

dynamic hyperlink

sevenelevenseveneleven Posts: 6Questions: 0Answers: 0
edited January 2011 in General
Hi,
Thanks DT is really is amazing!

My question is how I can get my column that contains http: address to be click-able and direct the user to that site. I have been looking for an answer in the forums all day now and haven't found an answer. I am using server-side

Thanks

Replies

  • allanallan Posts: 63,514Questions: 1Answers: 10,472 Site admin
    Basically what you need to do is make it a standard HTML link (A tag). There are two ways to do this with server-side processing:

    1. Simply have the server return an A tag with the HTML required
    2. Use fnRender ( http://datatables.net/usage/columns#fnRender ) to alter the string into the HTML needed.

    Allan
  • sevenelevenseveneleven Posts: 6Questions: 0Answers: 0
    Thank you,

    I am trying to work with fnRender having trouble with the syntax if someone doesnt mind giving me a hand here is what I have:

    [code]
    { "fnRender": function ( oObj ) {
    return = "'"oObj.aData[1]";
    } },
    [/code]
  • allanallan Posts: 63,514Questions: 1Answers: 10,472 Site admin
    [code]
    { "fnRender": function ( oObj ) {
    return = ''+oObj.aData[1]+'';
    } },
    [/code]
    Allan
  • sevenelevenseveneleven Posts: 6Questions: 0Answers: 0
    Thank you very much, worked perfectly
  • Keyser_SozeKeyser_Soze Posts: 22Questions: 0Answers: 0
    Hi,

    I'm trying to put links on my table, could you help me please? :(

    http://datatables.net/forums/comments.php?DiscussionID=3723&page=1#Item_0

    I didn't understand the code fnRender :s ... is it the solution for my problem? what shall i do?!

    Thanks
This discussion has been closed.