Commit 79321021 authored by Xiaowu Zhang's avatar Xiaowu Zhang

Fix listfield gadget's value error bug

Do not use append option which will change option's selected attribute to true
parent df7eb0fd
......@@ -166,17 +166,13 @@
// XXX: no fan...\n
var option_list,\n
i_len,\n
fragment = document.createDocumentFragment(),\n
select_div,\n
div = document.createElement("div");\n
\n
div.innerHTML = my_translated_html;\n
option_list = div.querySelectorAll("option");\n
for (i = 0, i_len = option_list.length; i < i_len; i += 1) {\n
fragment.appendChild(option_list[i]);\n
}\n
\n
select.appendChild(fragment);\n
// XXX: no fan end\n
select_div = div.querySelector("select");\n
select.innerHTML = select_div.innerHTML;\n
\n
if (field_json.required === 1) {\n
select.setAttribute(\'required\', \'required\');\n
......@@ -320,7 +316,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <string>xiaowu</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -334,7 +330,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>940.16203.52595.49561</string> </value>
<value> <string>940.21609.3247.37922</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -352,8 +348,8 @@
</tuple>
<state>
<tuple>
<float>1421081098.25</float>
<string>GMT</string>
<float>1421405407.17</float>
<string>UTC</string>
</tuple>
</state>
</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