Get a cell value with help of table id

Get a cell value with help of table id

Per77Per77 Posts: 16Questions: 7Answers: 0

Hello Everyone,

Is it possible to get the value of a cell help of the Table id?

I use this and get my table id. But how can I willhelp of this id get the cell value for row=1, column=1?

var tableID = $(this).closest('table').attr('id');

/P

Answers

  • kthorngrenkthorngren Posts: 20,299Questions: 26Answers: 4,769

    Use the table ID to get an instance of the Datatables API (assuming you are using Datatables). See the API docs for more info. Then use `-api cell().data() to get the data. For example:

    var row = 1;
    var column = 1;
    var tableID = $(this).closest('table').attr('id');
    var table = $(tableID).DataTable();
    var data = table.cell( row, column ).data();
    

    Kevin

This discussion has been closed.