Number field to display one value and hold another value for calculation
Number field to display one value and hold another value for calculation
Hi All,
We need help in understanding how we can display a column to display number rounded to different decimal and store original value .
In short we want this:
1. Display upto x decimal place rounded (Example : 12.4399)
2. Actual data from server is having much higher decimal place (Example: 12.4398732)
3. On focus, user should see the actual data (12.4398732)
4. On Blur / Submit it should round to x decimal place (Ex 12.4399 - see the rounding)
5. While fetching the data [rows().data()] it should always fetch 12.4398732
Now we know the concept for "render" and "editField". But in this way we need to duplicate fields for every field that we intend to implement this functionality. This will result it too many duplication of fields un-necessary in our code.
Can we somehow avoid having another field?
Replies
added sample image from what is explained above. We want something like this.
Use Orthogonal data to return the number as you want it displayed for the
display
type. This will only affect how its displayed and not what the Editor shows orrow().data()
. Here is a simple example:https://live.datatables.net/guwafemu/416/edit
Kevin
Hi @kthorngren,
Thanks for your quick reply. I will try this.