Quantcast
Channel: DataTables 1.10 — DataTables forums
Viewing all articles
Browse latest Browse all 2364

call function on cell button click

$
0
0

in my datatable i have 2 rendered button links in each row, each to perform a specific function.

what i want to do is have an on click event for each button, so when each button is clicked, some of the row data is used in each function

i can retrieve the cell data ok

$('#example tbody').on('click', 'td', function () {

    var table = $('#example').DataTable();

    alert( table.cell( this ).data() );
)};

i can retrieve the row data ok

$('#example tbody').on('click', 'tr', function () {

    var table = $('#example').DataTable();

    alert( table.row( this ).data(); );
)};

using the example here http://editor.datatables.net/examples/simple/inTableControls.html

i have a function which fires on the click event of the button link

$('#example').on('click', 'a.ajaxresub', function (e) {
    e.preventDefault();

but can't work out a way to retrieve the row data

var data = $(this).closest('tr'); doesn;t return anything


Viewing all articles
Browse latest Browse all 2364

Trending Articles