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
preetwinder
erp5
Commits
4477ebf1
Commit
4477ebf1
authored
Dec 27, 2016
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Force float value to be displayed with the requested precision
parent
20793c52
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
5 deletions
+7
-5
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_floatfield_js.js
...lateItem/web_page_module/rjs_gadget_erp5_floatfield_js.js
+4
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_floatfield_js.xml
...ateItem/web_page_module/rjs_gadget_erp5_floatfield_js.xml
+2
-2
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormViewEditableField.zpt
...rjs_ui_page_templates_zuite/testFormViewEditableField.zpt
+1
-1
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_floatfield_js.js
View file @
4477ebf1
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
.
declareMethod
(
'
render
'
,
function
(
options
)
{
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
field_json
=
options
.
field_json
||
{},
var
field_json
=
options
.
field_json
||
{},
value
=
field_json
.
value
||
field_json
.
default
||
""
,
state_dict
=
{
state_dict
=
{
value
:
field_json
.
value
||
field_json
.
default
||
""
,
editable
:
field_json
.
editable
,
editable
:
field_json
.
editable
,
required
:
field_json
.
required
,
required
:
field_json
.
required
,
name
:
field_json
.
key
,
name
:
field_json
.
key
,
...
@@ -21,12 +21,14 @@
...
@@ -21,12 +21,14 @@
precision
:
field_json
.
precision
,
precision
:
field_json
.
precision
,
hidden
:
field_json
.
hidden
hidden
:
field_json
.
hidden
};
};
state_dict
.
text_content
=
state_dict
.
value
;
if
(
field_json
.
precision
)
{
if
(
field_json
.
precision
)
{
state_dict
.
step
=
1
/
Math
.
pow
(
10
,
field_json
.
precision
);
state_dict
.
step
=
1
/
Math
.
pow
(
10
,
field_json
.
precision
);
value
=
parseFloat
(
value
||
"
0
"
).
toFixed
(
field_json
.
precision
);
}
else
{
}
else
{
state_dict
.
step
=
0.00000001
;
state_dict
.
step
=
0.00000001
;
}
}
state_dict
.
value
=
value
;
state_dict
.
text_content
=
value
;
return
this
.
changeState
(
state_dict
);
return
this
.
changeState
(
state_dict
);
})
})
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_floatfield_js.xml
View file @
4477ebf1
...
@@ -230,7 +230,7 @@
...
@@ -230,7 +230,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
956.157
09.17217.39492
</string>
</value>
<value>
<string>
956.157
42.1027.50705
</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>
148284
2913.66
</float>
<float>
148284
4714.9
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormViewEditableField.zpt
View file @
4477ebf1
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
</tr>
</tr>
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
assertElementPresent
</td>
<td>
//input[@value='' and @name='field_my_quantity']
</td>
<td>
//input[@value='
0.0
' and @name='field_my_quantity']
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<tr>
...
...
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