Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ecommerce-ui
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
ecommerce-ui
Commits
8aa3aed6
Commit
8aa3aed6
authored
May 01, 2014
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app: add setKey to dynamically set properties in map.listItem
parent
525c2cc1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
js/erp5_loader.js
js/erp5_loader.js
+11
-7
No files found.
js/erp5_loader.js
View file @
8aa3aed6
...
...
@@ -1844,6 +1844,7 @@
// TODO: add collapsible support if needed
// TODO: dividers? will not be in spec, so can only be listview option!
// TODO: find better way to set mapper/widget
// TODO: make setParam/setValue/setKey generic over all widgets!
factory
.
widget
.
listview
=
function
(
spec
)
{
var
fragment
,
has_filter
,
generator
,
filter_id
;
...
...
@@ -2544,7 +2545,6 @@
"
type
"
:
is_type
?
"
checkbox
"
:
"
radio
"
,
"
data-i18n
"
:
"
[value]
"
,
"
data-enhanced
"
:
true
,
"
value
"
:
"
Select item
"
,
"
data-iconpos
"
:
"
notext
"
};
if
(
spec
.
action
)
{
...
...
@@ -3553,14 +3553,14 @@
// TODO: move radio/check into property_dict and item? or do same on tableItem
// TODO: not nice & find better handling for text elements and i18n tags
// TODO: subordinated fields should have links, not id only!!!
//
NOTE
: make sure there is no "id" flying through here!!! only _id
//
TODO
: make sure there is no "id" flying through here!!! only _id
map
.
listItem
=
function
(
spec
)
{
var
quirk_dict
,
section
,
label
,
j
,
k
,
field
,
setter
,
record
,
new_item
,
id
,
key
,
translation_fields
,
item
,
relation
,
promise_list
,
pass
,
count
,
class_string
;
promise_list
=
[];
translation_fields
=
"
titletextlabel
"
;
translation_fields
=
"
titletextlabel
"
;
quirk_dict
=
spec
.
wrapper
.
property_dict
;
item
=
spec
.
item
;
record
=
item
.
doc
;
...
...
@@ -3614,6 +3614,7 @@
"
record
"
:
record
,
"
position
"
:
section
.
position
,
"
key
"
:
key
,
"
setKey
"
:
field
.
setKey
,
"
field
"
:
field
,
"
text_element
"
:
translation_fields
.
indexOf
(
key
)
>
-
1
};
...
...
@@ -3634,10 +3635,11 @@
return
RSVP
.
all
(
promise_list
)
.
then
(
function
(
response_list
)
{
var
l
,
len
,
response
,
obj
,
setter
,
pos
;
var
l
,
len
,
response
,
obj
,
setter
,
pos
,
setter_key
;
for
(
l
=
0
,
len
=
response_list
.
length
;
l
<
len
;
l
+=
1
)
{
response
=
response_list
[
l
];
setter_key
=
response
.
key
;
pos
=
response
.
position
;
obj
=
{};
new_item
[
pos
]
=
new_item
[
pos
]
||
[];
...
...
@@ -3645,15 +3647,16 @@
// text/label/... all stuff translateable
if
(
response
.
text_element
)
{
obj
[
response
.
key
+
"
_18n
"
]
=
record
[
response
.
key
+
"
_i18n
"
];
setter
=
key
;
obj
[
setter_key
+
"
_18n
"
]
=
record
[
setter_
key
+
"
_i18n
"
];
setter
=
setter_
key
;
}
else
{
setter
=
"
value
"
;
setter
=
response
.
setKey
||
"
value
"
;
}
obj
[
setter
]
=
response
.
value
;
new_item
[
pos
].
push
(
util
.
mergeObject
(
response
.
field
,
obj
));
}
return
new_item
;
})
.
fail
(
app
.
util
.
error
);
...
...
@@ -7113,6 +7116,7 @@
break
;
}
}
return
initial_query
;
};
...
...
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