How to access data Object
How to access data Object
Akhor
Posts: 6Questions: 0Answers: 0
Hi,
How can I access the columns full mData when a table is setup like below:
var columns = [ { mData: dynamic.title } ];
var data = [ { dynamic: {title:'Test', desc: 'description', value3: 'val3' } } ];
$('#table').dataTable( {aaData: data, aoColumns: columns, fnCreatedCell: function(nTD,sData,oData,iRow,iCol){
alert( sData ); //Shows "Test"
//How can I get the whole object?
// { dynamic: {title:'test', desc: 'description', value3: 'val3' }
} });
How can I access the columns full mData when a table is setup like below:
var columns = [ { mData: dynamic.title } ];
var data = [ { dynamic: {title:'Test', desc: 'description', value3: 'val3' } } ];
$('#table').dataTable( {aaData: data, aoColumns: columns, fnCreatedCell: function(nTD,sData,oData,iRow,iCol){
alert( sData ); //Shows "Test"
//How can I get the whole object?
// { dynamic: {title:'test', desc: 'description', value3: 'val3' }
} });
This discussion has been closed.
Replies
Allan
mRender: function (data, type,val){
if (type === 'display'){
return data;
}else if (type === 'filter'){
return data.display;
}
return data;
} };