Remove trailing white space in the editor?

Remove trailing white space in the editor?

Greg BrainerdGreg Brainerd Posts: 9Questions: 1Answers: 0

I'm working with the editor and double clicking on a cell to change it the field displays the white space saved. It appears that the white space is trimmed while in the viewing mode of the table. Is there an option to toggle the whitespace off for a specific table during editing?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 64,478Questions: 1Answers: 10,654 Site admin
    Answer ✓

    DataTables and / or Editor shouldn't be adding any white space. If that is happening, its a bug, and it would be great if you could give me a link to the page so I can investigate.

    Having said that, if the white space is in the data already, then it is operating correctly. You could either update the data in the database, or use a set formatter to clean the data up before saving to the database if you would rather do it as fields are edited.

    Allan

  • Greg BrainerdGreg Brainerd Posts: 9Questions: 1Answers: 0
    edited August 2016

    The formatter worked. I added this to the field.
    .SetFormatter((val, data) => val.ToString().Trim())
    .GetFormatter((val, data) => val.ToString().Trim())

    Thanks Allan.

This discussion has been closed.