When I edit a grid row (using a dialog template), any text fields that are initially blank in the local data JSON are changed to undefined upon clicking save in the edit dialog, even when no edits are made. If the record is edited a second time, the field text is displayed as "undefined" AND the JSON is changed to the TEXT string of "undefined" (not the null privative) upon save.
So my local data object goes through these iterations upon two edit cycles.
{id: 1, zip: ""} -> {id:1, zip: undefined} -> {id:1, zip: "undefined"}
I believe that the issue is in the template engine code that sets the inputs initial value. I use something like the following in my editing template:
<input id="HallZip" name="zip" type="text" value="${if(isAdd)}''${else}${zip}${/if}" />
Why does ${zip} evaluate to "undefined"? Now, for this example, the value attribute is wrapped in double quotes. I did this because the field value may contain an embedded space, e.g. "ABC 123". If I leave off the quotes, the value is set to "ABC" instead of "ABC 123".
What is the best way to deal with empty fields and fields with embedded spaces?