Problem with a clickable row.
Problem with a clickable row.
easyjava
Posts: 2Questions: 0Answers: 0
Hello and thank you for having developed Datatable!
I'm trying to make a clickable row recovering an ID that is in a hidden column. But it does not work!
Can you help me?
In advance thank you.
[code]
jQuery(function($) {
$(document).ready(function() {
var oTable = $('#customers').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "json_customers.php",
"sPaginationType": "full_numbers",
"oLanguage": {
"sUrl": "../../includes/tables/french.txt"
},
"aoColumnDefs": [
{ "bVisible": false, "aTargets": [ 0 ] }
]
} );
/* Add events */
$('#customers tbody tr').click( function () {
var aData = oTable.fnGetData( this );
alert( aData[0] );
} );
} );
});
[/code]
I'm trying to make a clickable row recovering an ID that is in a hidden column. But it does not work!
Can you help me?
In advance thank you.
[code]
jQuery(function($) {
$(document).ready(function() {
var oTable = $('#customers').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "json_customers.php",
"sPaginationType": "full_numbers",
"oLanguage": {
"sUrl": "../../includes/tables/french.txt"
},
"aoColumnDefs": [
{ "bVisible": false, "aTargets": [ 0 ] }
]
} );
/* Add events */
$('#customers tbody tr').click( function () {
var aData = oTable.fnGetData( this );
alert( aData[0] );
} );
} );
});
[/code]
This discussion has been closed.
Replies
Allan
[code]
jQuery(function($) {
$(document).ready(function() {
var oTable = $('#customers').dataTable( {
"aaSorting": [[0,'desc']],
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "json_customers.php",
"sPaginationType": "full_numbers",
"aoColumnDefs": [
{ "bVisible": false, "aTargets": [ 0 ] }
],
"fnDrawCallback": function(oSettings) {
$('#customers tbody tr').bind('click', function () {
var aData = oTable.fnGetData( this );
alert( aData[0] );
})
}
} );
} );
});
[/code]