How to customize columns display with server side processing.
How to customize columns display with server side processing.
robin12
Posts: 2Questions: 0Answers: 0
Hello everyone,
I started to use server side processing (for PHP/MySQL) but I have a problem.
Before I displayed my Datatables like this :
............
<?php
$sql="SELECT * FROM songs";
$req= mysql_query($sql) or die('SQL Error!
'.$sql.'
'.mysql_error());
while($data=mysql_fetch_assoc($req)){
?>
<!-- Display song -->
<?php echo html_entity_decode($data["song"]); ?>
<?php echo nl2br(html_entity_decode($data['transcript'])); ?>
<?php
}
?>
Now I use server side processing, but all data appear without style and without html_entity_decode function.
I would like to display
- into column 1 : bold text and use html_entity_decode.
- into column 2: use nl2br and html_entity_decode.
Do I have to edit this file : http://www.datatables.net/development/server-side/php_mysql
Here is what I have done :
$(document).ready(function() {
$('#liste').dataTable( {
"sDom": "<'row'<'span6'l><'span6'>r>t<'row'<'span6'i>>p",
"bLengthChange": false,
"iDisplayLength": 10,
"bSort": true,
"bSortClasses": false,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "pages/toto.php",
"aoColumnDefs": [
{ 'bSortable': false, 'aTargets': [ 1 ] },
]
} );
} );
Thank you
I started to use server side processing (for PHP/MySQL) but I have a problem.
Before I displayed my Datatables like this :
............
<?php
$sql="SELECT * FROM songs";
$req= mysql_query($sql) or die('SQL Error!
'.$sql.'
'.mysql_error());
while($data=mysql_fetch_assoc($req)){
?>
<!-- Display song -->
<?php echo html_entity_decode($data["song"]); ?>
<?php echo nl2br(html_entity_decode($data['transcript'])); ?>
<?php
}
?>
Now I use server side processing, but all data appear without style and without html_entity_decode function.
I would like to display
- into column 1 : bold text and use html_entity_decode.
- into column 2: use nl2br and html_entity_decode.
Do I have to edit this file : http://www.datatables.net/development/server-side/php_mysql
Here is what I have done :
$(document).ready(function() {
$('#liste').dataTable( {
"sDom": "<'row'<'span6'l><'span6'>r>t<'row'<'span6'i>>p",
"bLengthChange": false,
"iDisplayLength": 10,
"bSort": true,
"bSortClasses": false,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "pages/toto.php",
"aoColumnDefs": [
{ 'bSortable': false, 'aTargets': [ 1 ] },
]
} );
} );
Thank you
This discussion has been closed.