How to append someting or render a column for serverside datatable ?
How to append someting or render a column for serverside datatable ?
I need to add a percentage sign to a column, I would like to keep it as a numeric value and append a "%" sign for the values of the column. My Datatable creation is from the server side.
"columns": [
{ data: 'Process_Level', name: "Process_Level ", autowidth: true },
{ data: 'org_Name', name: "org_Name", autowidth: true },
{ data: 'PayRoll_Prv', name: "PayRoll_Prv", autowidth: true },
{ data: 'PayRoll_Cur', name: 'PayRoll_Cur', autowidth: true },
{ data: 'Payroll_Var', name: 'Payroll_Var', autowidth: true },
{ data: 'PayRollVarPer', name: 'PayRollVarPer', autowidth: true },
{ data: 'PayRollTotRecPrv', name: 'PayRollTotRecPrv', autowidth: true },
{ data: 'PayRollTotRecCur', name: 'PayRollTotRecCur', autowidth: true },
{ data: 'PayRollTotVar', name: 'PayRollTotVar', autowidth: true },
{ data: 'PayRollTotBatPrv', name: 'PayRollTotBatPrv', autowidth: true },
{ data: 'PayRollTotBatCur', name: 'PayRollTotBatCur', autowidth: true },
{ data: 'PayRollBatVar', name: 'PayRollBatVar', autowidth: true },
],
This is how I am binding the data to the table after the ajax call . Btw I am using C# for asp.net mvc project.
This question has an accepted answers - jump to answer
Answers
Using Orthogonal Data you can display the percentage sign but keep the numeric value for sorting and searching.
Kevin
@kthorngren I tried rendering but the data field ends up being null . I would greatly appreciate it If you could point me to a example similar to mine.
Both the page I referenced and the
columns.render
page have some examples. I put together a simple one for you:http://live.datatables.net/nihevivi/1/edit
Kevin
Thanks @kthorngren
]
});