Button instead of a link in the table cell

Button instead of a link in the table cell

vivekmd06vivekmd06 Posts: 7Questions: 0Answers: 0
edited April 2013 in General
Hi,

I am using datatables & the dataset contains a huge link, which is displayed in the cell of the table. My json data contains the foll:-

[code]
{ "aaData": [
["Application 1","http://someurl/abc/def/something1.html"],
["Application 2","http://someurl/abc/def/something2.html"],
["Application 3","http://someurl/abc/def/something3.html"],
["Application 4","http://someurl/abc/def/something4.html"],
["Application 5","http://someurl/abc/def/something5.html"],
["Application 6","http://someurl/abc/def/something6.html"],

] }

[/code]

Since the link displayed in the table doesnt look too good, hence am looking to use a button instead of the link to be displayed in the table.
When the user clicks on the button It would take him to that relevant link.

The button html I would be using would be as follows;-

[code]

[/code]

Any help on this is appreciated. Thanks for looking.

Replies

  • girishmrgirishmr Posts: 137Questions: 0Answers: 0
    You should use aoColumnsDefs and mRender within this. 'n' below is the column number (starting at 0) where you want your button to be rendered

    [code]
    "aoColumnDefs": [
    "aTargets":[n],
    "mRender": function( data, type, full ) {
    return '';
    }
    ]
    [/code]
  • vivekmd06vivekmd06 Posts: 7Questions: 0Answers: 0
    Worked perfectly. Appreciate it.
This discussion has been closed.