Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xueyun Qian
erp5
Commits
2c0d6e8a
Commit
2c0d6e8a
authored
Feb 05, 2015
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add requied functionality for listfield gadget
parent
e3f8dfcf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
9 deletions
+36
-9
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listfield_js.xml
...lateItem/web_page_module/rjs_gadget_erp5_listfield_js.xml
+36
-9
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listfield_js.xml
View file @
2c0d6e8a
...
...
@@ -101,7 +101,7 @@
<key>
<string>
text_content
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
/*global window, rJS, Handlebars, document, RSVP
*/\n
/*global window, rJS, Handlebars, document, RSVP
, loopEventListener
*/\n
/*jslint nomen: true, indent: 2, maxerr: 3 */\n
(function (window, rJS, Handlebars, document, RSVP) {\n
"use strict";\n
...
...
@@ -132,7 +132,8 @@
// acquired method\n
//////////////////////////////////////////////\n
.declareAcquiredMethod("translateHtml", "translateHtml")\n
\n
.declareAcquiredMethod("notifyValid", "notifyValid")\n
.declareAcquiredMethod("notifyInvalid", "notifyInvalid")\n
.declareMethod(\'render\', function (options) {\n
var i,\n
template,\n
...
...
@@ -164,9 +165,7 @@
})\n
.push(function (my_translated_html) {\n
// XXX: no fan...\n
var option_list,\n
i_len,\n
select_div,\n
var select_div,\n
div = document.createElement("div");\n
\n
div.innerHTML = my_translated_html;\n
...
...
@@ -185,12 +184,40 @@
}\n
});\n
})\n
\n
.declareMethod(\'checkValidity\', function () {\n
var result;\n
result = this.element.querySelector(\'select\').checkValidity();\n
if (result) {\n
return this.notifyValid()\n
.push(function () {\n
return result;\n
});\n
}\n
return result;\n
})\n
.declareMethod(\'getContent\', function () {\n
var input = this.element.querySelector(\'select\'),\n
result = {};\n
result[input.getAttribute(\'name\')] = input.options[input.selectedIndex].value;\n
return result;\n
})\n
.declareService(function () {\n
////////////////////////////////////\n
// Inform when the field input is invalid\n
////////////////////////////////////\n
var field_gadget = this;\n
\n
function notifyInvalid(evt) {\n
return field_gadget.notifyInvalid(evt.target.validationMessage);\n
}\n
\n
// Listen to input change\n
return loopEventListener(\n
field_gadget.element.querySelector(\'select\'),\n
\'invalid\',\n
false,\n
notifyInvalid\n
);\n
});\n
\n
}(window, rJS, Handlebars, document, RSVP));
...
...
@@ -316,7 +343,7 @@
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
xiaowu
</string>
</value>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
...
...
@@ -330,7 +357,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
940.
21609.3247.37922
</string>
</value>
<value>
<string>
940.
49457.43407.46148
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -348,7 +375,7 @@
</tuple>
<state>
<tuple>
<float>
142
1405407.17
</float>
<float>
142
3135404.46
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment