Hyperlink with serverside php

Hyperlink with serverside php

Lukas_tableLukas_table Posts: 2Questions: 1Answers: 0
edited June 2018 in Free community support

Hey!

try to get one of the columns turned into a hyperlink. i already followed the instructions in this forum, but without luck. do i have to handle the data in an other way, when i am using a php script to get the data?

<script type="text/javascript" language="javascript" class="init">
$(document).ready(function() {
    $('#example').DataTable( {
        "bprocessing": true,
        "bserverSide": true,
        "sAjaxSource": "server_processing.php"
        "data": responseObj,
        "columns":[
            { "data":"fb_massage" },
            { "data":"fb_time" },
            { "data":"fb_date" },
            { "data":"fb_id","render": function(data, type, row, meta){if(type = 'display'){data = '<a href="www.facebook.com + 'data'">See Entry<a>';}}},
            { "data":"fb_type" },
            { "data":"ibm_topclass" },
            { "data":"ibm_prec" },
            { "data":"status" }
        ]
    } );
    } );
</script>

seems to be an error in the script. but i really cant figure out whats wrong. really appreciate any help.

thx in advance.

lukas

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin
    Answer ✓

    You need to return the link from the rendering function. See the columns.render documentation for an example.

    Allan

  • Lukas_tableLukas_table Posts: 2Questions: 1Answers: 0

    Thanks a lot for the fast answer. It works now :)

This discussion has been closed.