Adding Link or Button into the DataTable Row

Adding Link or Button into the DataTable Row

hosainhosain Posts: 3Questions: 0Answers: 0
edited October 2010 in General
Hi,

How can I add link or Button as an element or content of a DataTable Row.
As if I click the link or Button in the DataTable row it will do some javascript work or go to some other pages.

Regards

Hosain.

Replies

  • anjibmananjibman Posts: 115Questions: 10Answers: 0
    This link might help you

    http://www.datatables.net/examples/api/row_details.html

    or you can just add a column and put or on that column.

    Anjib
  • bkkumarbkkumar Posts: 1Questions: 0Answers: 0
    edited April 2012
    If you have 6 columns displayed in DTable and want to add Seventh column as "More" link, in each record, then do the following. Add "aoColumns" derivative with 6 null and 7th as your link using fnRender. Parameters to link url can also be passed as mentioned below.





    $(document).ready(function() {
    $('#example').dataTable( {
    "sScrollX": "100%",
    "sScrollXInner": "100%",
    "bProcessing": true,
    "bServerSide": true,
    "aaSorting": [[1, "asc"]],
    "sPaginationType": "full_numbers",
    "aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]], [code]
    "aoColumns":[
    null,null,null,null,null,null,
    { "fnRender": function (oObj) {
    return '' + 'More' + '';
    }
    }
    ],
    [/code]
    "sAjaxSource": "scripts/team_processing.php"



    } );
    } );
This discussion has been closed.