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
Labels
Merge Requests
139
Merge Requests
139
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
e3eb3402
Commit
e3eb3402
authored
Aug 03, 2016
by
Xiaohe Cao
Committed by
Romain Courteaud
Aug 05, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Listen to listfield change
parent
5dee8f09
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listfield_js.js
...plateItem/web_page_module/rjs_gadget_erp5_listfield_js.js
+24
-0
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
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listfield_js.js
View file @
e3eb3402
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
.
declareAcquiredMethod
(
"
translateHtml
"
,
"
translateHtml
"
)
.
declareAcquiredMethod
(
"
translateHtml
"
,
"
translateHtml
"
)
.
declareAcquiredMethod
(
"
notifyValid
"
,
"
notifyValid
"
)
.
declareAcquiredMethod
(
"
notifyValid
"
,
"
notifyValid
"
)
.
declareAcquiredMethod
(
"
notifyInvalid
"
,
"
notifyInvalid
"
)
.
declareAcquiredMethod
(
"
notifyInvalid
"
,
"
notifyInvalid
"
)
.
declareAcquiredMethod
(
"
notifyChange
"
,
"
notifyChange
"
)
.
declareMethod
(
'
getTextContent
'
,
function
()
{
.
declareMethod
(
'
getTextContent
'
,
function
()
{
var
select
=
this
.
element
.
querySelector
(
'
select
'
);
var
select
=
this
.
element
.
querySelector
(
'
select
'
);
return
select
.
options
[
select
.
selectedIndex
||
0
].
text
;
return
select
.
options
[
select
.
selectedIndex
||
0
].
text
;
...
@@ -102,6 +103,29 @@
...
@@ -102,6 +103,29 @@
result
[
input
.
getAttribute
(
'
name
'
)]
=
input
.
options
[
input
.
selectedIndex
].
value
;
result
[
input
.
getAttribute
(
'
name
'
)]
=
input
.
options
[
input
.
selectedIndex
].
value
;
return
result
;
return
result
;
})
})
.
declareService
(
function
()
{
////////////////////////////////////
// Check field validity when the value changes
////////////////////////////////////
var
field_gadget
=
this
;
function
notifyChange
()
{
return
RSVP
.
all
([
field_gadget
.
checkValidity
(),
field_gadget
.
notifyChange
()
]);
}
// Listen to input change
return
loopEventListener
(
field_gadget
.
element
.
querySelector
(
'
select
'
),
'
change
'
,
false
,
notifyChange
);
})
.
declareService
(
function
()
{
.
declareService
(
function
()
{
////////////////////////////////////
////////////////////////////////////
// Inform when the field input is invalid
// Inform when the field input is invalid
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listfield_js.xml
View file @
e3eb3402
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
49.15483.53582.1595
7
</string>
</value>
<value>
<string>
9
52.64761.25287.1839
7
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -248,7 +248,7 @@
...
@@ -248,7 +248,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
14
55899167.96
</float>
<float>
14
70231990.11
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</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