render the editor field using display as the field type
render the editor field using display as the field type
I want to display a currency value in my editor instance for information only, but would like to render it so it shows as it does in the datatable.
eg, If the value is 2, it is rendered in the table to £2.00 using render: $.fn.dataTable.render.number( ',', '.', 2, '£' )
Is it possible to do the same within editor ?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Editor doesn't have a rendering option for data, so no, not directly since it is assumed it will always be editing the raw data.
However, you might want to take a look at the masked input type plug-in which might suit your needs.
Allan
Thanks Allan,
That looks promising, but am I able to have the data of type 'masked' AND 'display' ?
Sorry, I didn't realise you want just display information only. No, you would need a custom plug-in for that which does the formatting (or perhaps adjust the display plug-in to be able to provide it with a formatting function would be best).
Allan
Okay, will have a play with it