fnGetData is not a function - trying to get data for row
fnGetData is not a function - trying to get data for row
sergeda
Posts: 42Questions: 16Answers: 0
I'm trying to get data for row and hidden columns.
Here is my table:
corpTable=container.find('#corporations_table').DataTable( {
"columns": [
{ "data": "name" },
{ "data": "phone" },
{ "data": "email" },
{ "data": "manager" },
{ "data": "address" },
{ "data": "about" },
{
"data": null,
defaultContent: container.edit_buttons
}
],
"columnDefs": [
{"aTargets": "corp_address", "bVisible": false},
{"aTargets": "corp_about", "bVisible": false}
],
//'bFilter': false,
dom: "Tfrtip",
tableTools: {
sRowSelect: "os",
aButtons: [
{ sExtends: "editor_create", editor: container.editor }
]
}
} );
Here is how I try to get data from it:
container.viewC=function(){
var tr=$(this).parents('tr');
var data=corpTable.fnGetData(tr);
};
container.find('#corporations_table').on('click','.view',container.viewC);
What I'm doing wrong?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Second top FAQ. Specifically in this case you are using the old style API ( fnGetData ) with a new style API object. I would suggest you use
row().data()
instead.Allan
Thank you Allan a lot