jquery - DataTables extra column with button -



jquery - DataTables extra column with button -

i using datatables.

code <script type="text/javascript" charset="utf-8"> $(document).ready(function() { $('#table').datatable( { "lengthmenu": [[10, 25, 50, -1], [10, 25, 50, "all"]], "serverside": true, "ajax": { "url": "../server_processing/orders.php", "type": "post" }, "order": [[ 0, "desc" ]], "processing": true, "aocolumndefs": [ { "atargets": [ 0 ], "mrender": function ( data, type, total ) { homecoming '<a href="order?id=' + full[0] + '">' + info + '</a>'; } }, { "mrender": function ( data, type, total ) { homecoming '<a href=\'view.php?id=\'' + full[0] + '\' class=\'btn btn-primary\'>view</a>'; } } ] } ); } ); </script>

i want add together column @ end , each row has button:

<a href="view.php?id=xxxxxx" class="btn btn-primary">contact sales</a>

the xxxxxx should contents of row 1.

is possible?

without code can guess @ table initialisation , datatables version, using 1.9 can this:

'aocolumns': [ { 'mrender': function (data, type, full) { homecoming '<a href=\'view.php?id=\'' + full[0] + '\' class=\'btn btn-primary\'>contact sales</a>'; }

full[0] value returned in first field of json data.

jquery jquery-datatables

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -