Change the data before inserting the data in to the table
Change the data before inserting the data in to the table
I am able to construct a data table using the code below.But now I want to change the data before it gets inserted to table tbData,like changing the format of the date and add 20% to the price.How do I do this?
[code]
$('#tbData').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "getItems",
"aoColumns": [
{ "mDataProp": "itemID" },
{ "mDataProp": "itemName" },
{ "mDataProp": "itemPrice" },
{ "mDataProp": "itemCount" },
{ "mDataProp": "itemDate" }
],
"sPaginationType": "full_numbers",
"bLengthChange": false,
"iDisplayLength": 20
});
[/code]
[code]
$('#tbData').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "getItems",
"aoColumns": [
{ "mDataProp": "itemID" },
{ "mDataProp": "itemName" },
{ "mDataProp": "itemPrice" },
{ "mDataProp": "itemCount" },
{ "mDataProp": "itemDate" }
],
"sPaginationType": "full_numbers",
"bLengthChange": false,
"iDisplayLength": 20
});
[/code]
This discussion has been closed.