Commit 5080aca4 authored by Ivan Tyagov's avatar Ivan Tyagov

Split generic Tabbular gadget from ERP5 form rendering using gadgets.

parent 31666ee6
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</item> </item>
<item> <item>
<key> <string>_EtagSupport__etag</string> </key> <key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts37002880.65</string> </value> <value> <string>ts37244071.21</string> </value>
</item> </item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
...@@ -138,20 +138,20 @@ var TabbularGadget = {\n ...@@ -138,20 +138,20 @@ var TabbularGadget = {\n
visible_dom.removeClass("not_selected");\n visible_dom.removeClass("not_selected");\n
},\n },\n
\n \n
addNewTabGadget: function(form_id, dom_id, gadget_data_handler) {\n addNewTabGadget: function(dom_id, gadget, gadget_data_handler, gadget_data_source) {\n
// add new gadget and render it\n /*\n
* add new gadget and render it\n
*/\n
var html_string;\n var html_string;\n
tab_container=$(\'#\'+dom_id);\n tab_container=$(\'#\'+dom_id);\n
tab_container.empty();\n tab_container.empty();\n
// XXX: allow add any gadget,gadget:source items within API\n
html_string =[\'<div class="gadget" \',\n html_string =[\'<div class="gadget" \',\n
\'gadget="\' + form_id + \'/Form_asRenderJSGadget" \',\n \'gadget="\' + gadget + \'"\',\n
\'gadget:data-handler="\' + gadget_data_handler + \'" \',\n \'gadget:data-handler="\' + gadget_data_handler + \'" \',\n
\'gadget:data-source="Form_asJSON?form_id=\' + form_id + \'"></div>\'].join(\'\\n\');\n \'gadget:data-source="\' + gadget_data_source +\'"></div>\'].join(\'\\n\');\n
\n \n
tab_container.append(html_string);\n tab_container.append(html_string);\n
tab_gadget = tab_container.find(".gadget");\n tab_gadget = tab_container.find(".gadget");\n
Form.setCurrentFormId(form_id);\n
\n \n
// render new gadget\n // render new gadget\n
is_ready = false;\n is_ready = false;\n
...@@ -168,7 +168,8 @@ var TabbularGadget = {\n ...@@ -168,7 +168,8 @@ var TabbularGadget = {\n
};\n };\n
\n \n
/*\n /*\n
Form field renderer\n Form field renderer.\n
Note: This is an ERP5 form implementation for the moment.\n
*/\n */\n
var Form = {\n var Form = {\n
\n \n
...@@ -769,7 +770,7 @@ var RenderJs = {\n ...@@ -769,7 +770,7 @@ var RenderJs = {\n
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>25373</int> </value> <value> <int>25334</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_EtagSupport__etag</string> </key> <key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts37003035.66</string> </value> <value> <string>ts37244023.74</string> </value>
</item> </item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
...@@ -37,7 +37,7 @@ function setupRenderJSTest(){\n ...@@ -37,7 +37,7 @@ function setupRenderJSTest(){\n
\n \n
module("TabularGadget");\n module("TabularGadget");\n
test(\'addNewTabGadget\', function(){\n test(\'addNewTabGadget\', function(){\n
TabbularGadget.addNewTabGadget("Person_view", "qunit-fixture", "FormUpdater.update");\n TabbularGadget.addNewTabGadget("qunit-fixture", "Person_view/Form_asRenderJSGadget", "FormUpdater.update", "Form_asJSON?form_id=Person_view");\n
equal($("#qunit-fixture").children(".gadget").length, 1);\n equal($("#qunit-fixture").children(".gadget").length, 1);\n
equal(GadgetIndex.getGadgetList().length, 1);\n equal(GadgetIndex.getGadgetList().length, 1);\n
\n \n
...@@ -80,7 +80,7 @@ function setupRenderJSTest(){\n ...@@ -80,7 +80,7 @@ function setupRenderJSTest(){\n
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>1755</int> </value> <value> <int>1812</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
13 14
\ No newline at end of file \ No newline at end of file
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