mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 16:44:39 +00:00
o When row-id isn't specified on a "edit" target, use an empty string
o On form <input> tags support the "type_formatter" attribute, which defines the function to call in order to convert data before sending it to the server. This eases type conversions when needed (e.g. '1' --> 1 using a wrapper which uses parseInt())
o Add support for list type <select> content which offers a sorted list of key,value,selected attributes in addition to the current named array store.
Full example to offer properly typed integers to a backend:
function form_format_integer(payload)
{
if (/^[+-]?[0-9]*$/.test(payload)) {
return parseInt(payload);
} else {
return payload;
}
}
<input type="text" type_formatter="form_format_integer" id="myform.quantity">
Sample data for list type <select> options:
"status":[{"key":null,"value":"-","selected":0},{"key":"PEN","value":"Pending","selected":1}]