Get variable from a Cell and populate a mysql query
Get variable from a Cell and populate a mysql query
Hi guys,
I new to Datatables and found it when on placement year out of University, its looks and works great but so far cant get it to take a value out of a cell save it as a variable in either php or javascript, i have everything else working i.e it runs of the serverside example and have got my column i want to use as a variable into hyperlinks using fnrender but cant work out how to save it as a variable. Does any body have a solution to this problem
here is my code so far
[code]
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aoColumns": [
/*id*/ { "bSortable": true, "fnRender": function ( oObj ) {
return ''+ oObj.aData[0]
+'' ; }, "aTargets": [ 0 ]},
/*name*/ null,
/*phone#*/ null,
/*click me*/ null,
],
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"sAjaxSource": "scripts/IDS8230_6_Country.php",
"aaSorting": [[0,'desc']],
"aoColumnDefs": [ {
"sClass": "center",
"aTargets": [ -2, -3 ]
} ],
} );
$ ('#ImbalanceData td').live ('click', function() {
alert($(this).data);
});
} );
[/code]
Cheers
Matt
I new to Datatables and found it when on placement year out of University, its looks and works great but so far cant get it to take a value out of a cell save it as a variable in either php or javascript, i have everything else working i.e it runs of the serverside example and have got my column i want to use as a variable into hyperlinks using fnrender but cant work out how to save it as a variable. Does any body have a solution to this problem
here is my code so far
[code]
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"aoColumns": [
/*id*/ { "bSortable": true, "fnRender": function ( oObj ) {
return ''+ oObj.aData[0]
+'' ; }, "aTargets": [ 0 ]},
/*name*/ null,
/*phone#*/ null,
/*click me*/ null,
],
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]],
"sAjaxSource": "scripts/IDS8230_6_Country.php",
"aaSorting": [[0,'desc']],
"aoColumnDefs": [ {
"sClass": "center",
"aTargets": [ -2, -3 ]
} ],
} );
$ ('#ImbalanceData td').live ('click', function() {
alert($(this).data);
});
} );
[/code]
Cheers
Matt
This discussion has been closed.