How to get column values with server-side data
How to get column values with server-side data
Hello everybody,
i'm sorry if i post a question already answered, i'm a newbie. I would like to fill an hidden input field of a form with all the values from one column of my datatable. I'm using server-side processing. What i have to add to the following code?
[code]
jQuery(document).ready(function() {
$('#mytab').dataTable({
'bProcessing': true,
'bServerSide': true,
'sAjaxSource': "<?php echo url_for('...') ?>",
"aoColumnDefs": [
{ "bVisible": false, "aTargets": [ 1 ] },
{ "bVisible": false, "aTargets": [ 4 ] }
],
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
var url = "<?php echo url_for('...') ?>";
$('td:eq(0)', nRow).html( '' + aData[ 0 ] + '' );
var checked;
if(aData[ 4 ] == 1){
checked = 'checked="checked"';
} else {
checked = '';
}
$('td:eq(3)', nRow).html( '' );
return nRow;
}
});
})[/code]
What can i do?
Thank you
Franco
i'm sorry if i post a question already answered, i'm a newbie. I would like to fill an hidden input field of a form with all the values from one column of my datatable. I'm using server-side processing. What i have to add to the following code?
[code]
jQuery(document).ready(function() {
$('#mytab').dataTable({
'bProcessing': true,
'bServerSide': true,
'sAjaxSource': "<?php echo url_for('...') ?>",
"aoColumnDefs": [
{ "bVisible": false, "aTargets": [ 1 ] },
{ "bVisible": false, "aTargets": [ 4 ] }
],
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
var url = "<?php echo url_for('...') ?>";
$('td:eq(0)', nRow).html( '' + aData[ 0 ] + '' );
var checked;
if(aData[ 4 ] == 1){
checked = 'checked="checked"';
} else {
checked = '';
}
$('td:eq(3)', nRow).html( '' );
return nRow;
}
});
})[/code]
What can i do?
Thank you
Franco
This discussion has been closed.
Replies