prestojs / prestojs

https://prestojs.com/
6 stars 1 forks source link

feature: async choices parseValue #173

Closed davecoates closed 2 years ago

davecoates commented 2 years ago
vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
prestojs ✅ Ready (Inspect) Visit Preview Aug 25, 2022 at 0:06AM (UTC)
davecoates commented 2 years ago

Yeah needs this change in async_chocies.html:

@@ -52,4 +52,9 @@ new AsyncChoices<{ {{options.label_field}}: string; {{options.value_field }}: {{
     getValue(item) {
         return item.{{ options.value_field }};
     },
+   {% if options.value_type_info == 'number' %}
+     parseValue(value) {
+        return Number(value);
+     },
+   {% endif %}
 })