Server Side Processing and Column Rendering
Server Side Processing and Column Rendering
Hi! I want to thank the man behind this awesome project... just found out about it 2 days ago.
Anyways, I recently followed the example on server side processing demo 'cause the result is more than 150k rows.. and now I'm stuck on displaying the correct format for date and price and putting links. I want to make my Date [23-Jan-2010] instead of the original [2010-01-23] and Price in 2 decimal places instead of the original 4. I have no problem when it's not server-side processing since I control the formats via PHP when I include the file in the tabs.
I hope somebody would help or guide me to achieve this.
Here is my code
[code]
$('#prices_tbl').dataTable({
"bJQueryUI" : true,
"sPaginationType": "full_numbers",
"aoColumns": [
{ "sTitle": "Date", "sClass": "text-center", "asSorting": [ "desc" ] },
{ "sTitle": "Stock Symbol", "sClass": "text-center" },
{ "sTitle": "Price", "sClass": "text-center",
"sType": 'numeric'
}
],
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "../ajax/pricelist.php"
});
[/code]
Anyways, I recently followed the example on server side processing demo 'cause the result is more than 150k rows.. and now I'm stuck on displaying the correct format for date and price and putting links. I want to make my Date [23-Jan-2010] instead of the original [2010-01-23] and Price in 2 decimal places instead of the original 4. I have no problem when it's not server-side processing since I control the formats via PHP when I include the file in the tabs.
I hope somebody would help or guide me to achieve this.
Here is my code
[code]
$('#prices_tbl').dataTable({
"bJQueryUI" : true,
"sPaginationType": "full_numbers",
"aoColumns": [
{ "sTitle": "Date", "sClass": "text-center", "asSorting": [ "desc" ] },
{ "sTitle": "Stock Symbol", "sClass": "text-center" },
{ "sTitle": "Price", "sClass": "text-center",
"sType": 'numeric'
}
],
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "../ajax/pricelist.php"
});
[/code]
This discussion has been closed.
Replies
On the server-side you want to d something a bit like shown in the demo script, line 161 - http://www.datatables.net/development/server-side/php_mysql . On the client-side, as I say, fnRender is the answer.
Allan
Thanks Allan for your help!^^