Commit ae3ee088 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_web_renderjs_ui: return field's value as array

parent 3cdab18e
...@@ -182,11 +182,11 @@ ...@@ -182,11 +182,11 @@
}\n }\n
// XXX add first + last class, needs to be improved\n // XXX add first + last class, needs to be improved\n
if (i === 0) {\n if (i === 0) {\n
wrapper_class_string = wrapper_class_string || ""; \n wrapper_class_string = wrapper_class_string || "";\n
wrapper_class_string += \'ui-first-child\';\n wrapper_class_string += \'ui-first-child\';\n
}\n }\n
if (i === translated_htmls.length - 1) {\n if (i === translated_htmls.length - 1) {\n
wrapper_class_string = wrapper_class_string || ""; \n wrapper_class_string = wrapper_class_string || "";\n
wrapper_class_string += \'ui-last-child\';\n wrapper_class_string += \'ui-last-child\';\n
}\n }\n
if (wrapper_class_string) {\n if (wrapper_class_string) {\n
...@@ -199,11 +199,14 @@ ...@@ -199,11 +199,14 @@
.declareMethod(\'getContent\', function () {\n .declareMethod(\'getContent\', function () {\n
var gadget = this,\n var gadget = this,\n
result = {},\n result = {},\n
tmp = [],\n
selects = this.props.element.querySelectorAll(\'select\'),\n selects = this.props.element.querySelectorAll(\'select\'),\n
i;\n i;\n
\n
for (i = 0; i < selects.length; i += 1) {\n for (i = 0; i < selects.length; i += 1) {\n
result[gadget.props.field_json.sub_select_key + "_" + i] = selects[i].options[selects[i].selectedIndex].value;\n tmp.push(selects[i].options[selects[i].selectedIndex].value);\n
}\n }\n
result[gadget.props.field_json.sub_select_key] = tmp;\n
result[gadget.props.field_json.sub_input_key] = 0;\n result[gadget.props.field_json.sub_input_key] = 0;\n
return result;\n return result;\n
});\n });\n
...@@ -330,7 +333,7 @@ ...@@ -330,7 +333,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>zope</string> </value> <value> <string>xiaowu</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -344,7 +347,7 @@ ...@@ -344,7 +347,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>941.1091.39269.24183</string> </value> <value> <string>944.12751.13272.54476</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -362,8 +365,8 @@ ...@@ -362,8 +365,8 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1424106460.96</float> <float>1436170826.41</float>
<string>GMT</string> <string>GMT+2</string>
</tuple> </tuple>
</state> </state>
</object> </object>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment