I am newbie to DataTable. here I am trying to get the of first cell value of a row when I click the viewlink associated with the row, instead of the value I am getting [object object].
heres my code
$(document).ready(function() {
// Delete a record
$('#example').on('click', 'a.editor_view', function (e) {
e.preventDefault();
var rowIndex = oTable.fnGetPosition( $(this).closest('tr')[0] );
aData = oTable.fnGetData($(this).parents('tr')[0]);
alert(aData);
} );
// DataTables init
var oTable=$('#example').dataTable( {
sDom: Tfrtip,
sAjaxSource: php/browsers.php,
aoColumns: [
{ mData: browser },
{ mData: engine },
{ mData: platform },
{ mData: grade, sClass: center },
{
mData: null,
sClass: center,
sDefaultContent: '<a href= class=editor_view>view</a> / <a href= class=editor_remove>Delete</a>'
}
]
} );
} );
HTML Table:
<table cellpadding=0 cellspacing=0 border=0 class=display id=example width=100%>
<thead>
<tr>
<th width=30%>Browser</th>
<th width=20%>Rendering engine</th>
<th width=20%>Platform(s)</th>
<th width=14%>CSS grade</th>
<th width=16%>Admin</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Browser</th>
<th>Rendering engine</th>
<th>Platform(s)</th>
<th>CSS grade</th>
<th>Admin</th>
</tr>
</tfoot>
Now when I Click on the view I need to Navigate to another page with the id like
view.php?id=125
Thank you