Convert diplayed data
Convert diplayed data
mikedmason
Posts: 39Questions: 12Answers: 0
in Editor
Hi,
Is there a way to convert the data while using Editor. For example we store the data in pounds but we want to display it in tons. So I would like to convert the field by dividing by 1000. (this would not be field they would edit but just see). Thanks for the input.
DataTables debugger link
http://debug.datatables.net/ohesoy
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You can use
fields.data
to convert, but you need to be very careful with that parameter as a function as it is a setter as well. i.e. consider:As a function you would need to write:
So yes, possible. but if you can put the data you want to edit into the data source, you might find that easier.
Allan
Thanks Allan. I will give it a go.
Thanks Allan, that worked perfectly
Just to confirm for anyone else reading this, it looks like the code above is applied to DataTables (
columns.data
andcolumns.render
) rather than Editor which does not (currently) have afields.render
option (it might, or might not in future - haven't decided yet!).Allan