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
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Frederic Thoma
erp5
Commits
a198b99c
Commit
a198b99c
authored
Aug 25, 2021
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: trigger gadgets after change select
parent
339d44af
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
107 additions
and
96 deletions
+107
-96
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
...emplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
+105
-94
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
...mplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
View file @
a198b99c
...
...
@@ -1168,7 +1168,12 @@
loading_element
.
textContent
=
'
(
'
+
pagination_message
+
'
)
'
;
})
.
push
(
function
()
{
var
sub_element_list
=
[];
var
sub_element_list
=
[
domsugar
(
"
option
"
,
{
"
value
"
:
""
,
"
text
"
:
"
----------
"
})
];
for
(
i
=
0
;
i
<
gadget
.
state
.
option_list
.
length
;
i
+=
1
)
{
sub_element_list
.
push
(
domsugar
(
"
option
"
,
{
...
...
@@ -1182,104 +1187,106 @@
gadget
.
element
.
firstChild
);
});
/*.push(function () {
var div = domsugar("div", {"class": "graphic-section"}),
gadget_list = [],
domain_list = JSON.parse(gadget.state.domain_list_json);
gadget.element.insertBefore(div, gadget.element.firstChild);
gadget_list.push(
gadget.declareGadget('gadget_graphic.html', {
scope: 'gadget_graphic',
element: div
})
);
for (i = 0; i < domain_list.length; i += 1) {
div = domsugar("div", {
"class": "graphic-section " + domain_list[i][0]
});
gadget.element.insertBefore(div, gadget.element.firstChild);
gadget_list.push(
gadget.declareGadget('gadget_graphic.html', {
scope: 'gadget_graphic_' + domain_list[i][0],
element: div
})
);
}
return RSVP.all(gadget_list);
})*/
/*.push(function (gadget_list) {
var default_param_list = JSON.parse(gadget.state.column_list_json),
domain_dict = JSON.parse(gadget.state.domain_dict_json),
domain_list = [],
queue_list = [],
group_by,
group_by_title,
domain_id,
domain;
for (domain_id in domain_dict) {
if (domain_dict.hasOwnProperty(domain_id)) {
domain = {
"domain_id": domain_id,
"domain_list": [],
"column_list": []
};
for (i = 0; i < domain_dict[domain_id].length; i += 1) {
domain.column_list.push(domain_dict[domain_id][i][0]);
domain.domain_list.push(domain_dict[domain_id][i][1]);
}
domain_list.push(domain);
}
});
}
else
if
(
modification_dict
.
hasOwnProperty
(
"
graphic_type
"
)
&&
modification_dict
.
graphic_type
!==
""
)
{
return
result_queue
.
push
(
function
()
{
var
div
=
domsugar
(
"
div
"
,
{
"
class
"
:
"
graphic-section
"
}),
gadget_list
=
[],
domain_list
=
JSON
.
parse
(
gadget
.
state
.
domain_list_json
);
gadget
.
element
.
insertBefore
(
div
,
gadget
.
element
.
firstChild
);
gadget_list
.
push
(
gadget
.
declareGadget
(
'
gadget_graphic.html
'
,
{
scope
:
'
gadget_graphic
'
,
element
:
div
})
);
for
(
i
=
0
;
i
<
domain_list
.
length
;
i
+=
1
)
{
div
=
domsugar
(
"
div
"
,
{
"
class
"
:
"
graphic-section
"
+
domain_list
[
i
][
0
]
});
gadget
.
element
.
insertBefore
(
div
,
gadget
.
element
.
firstChild
);
gadget_list
.
push
(
gadget
.
declareGadget
(
'
gadget_graphic.html
'
,
{
scope
:
'
gadget_graphic_
'
+
domain_list
[
i
][
0
],
element
:
div
})
);
}
return
RSVP
.
all
(
gadget_list
);
})
.
push
(
function
(
gadget_list
)
{
var
default_param_list
=
JSON
.
parse
(
gadget
.
state
.
column_list_json
),
domain_dict
=
JSON
.
parse
(
gadget
.
state
.
domain_dict_json
),
domain_list
=
[],
queue_list
=
[],
group_by
,
group_by_title
,
domain_id
,
domain
;
for
(
domain_id
in
domain_dict
)
{
if
(
domain_dict
.
hasOwnProperty
(
domain_id
))
{
domain
=
{
"
domain_id
"
:
domain_id
,
"
domain_list
"
:
[],
"
column_list
"
:
[]
};
for
(
i
=
0
;
i
<
domain_dict
[
domain_id
].
length
;
i
+=
1
)
{
domain
.
column_list
.
push
(
domain_dict
[
domain_id
][
i
][
0
]);
domain
.
domain_list
.
push
(
domain_dict
[
domain_id
][
i
][
1
]);
}
for (i = 0; i < default_param_list.length; i += 1) {
if (default_param_list[i][0].indexOf("_state") !== -1) {
group_by = default_param_list[i][0];
group_by_title = default_param_list[i][1];
domain_list
.
push
(
domain
);
}
}
for
(
i
=
0
;
i
<
default_param_list
.
length
;
i
+=
1
)
{
if
(
default_param_list
[
i
][
0
].
indexOf
(
"
_state
"
)
!==
-
1
)
{
group_by
=
default_param_list
[
i
][
0
];
group_by_title
=
default_param_list
[
i
][
1
];
}
}
if
(
gadget_list
)
{
queue_list
.
push
(
gadget_list
[
0
].
render
({
group_by
:
group_by
,
query_by
:
{},
title
:
gadget
.
state
.
title
,
list_method_template
:
gadget
.
state
.
list_method_template
,
list_method
:
gadget
.
state
.
list_method
,
layout
:
{
x
:
{
"
title
"
:
group_by_title
,
"
key
"
:
group_by
},
y
:
{
"
title
"
:
"
Quantity
"
}
}
if (gadget_list) {
queue_list.push(gadget_list[0].render({
group_by: group_by,
query_by: {},
title: gadget.state.title,
list_method_template: gadget.state.list_method_template,
list_method: gadget.state.list_method,
layout: {
x: {
"title": group_by_title,
"key": group_by
},
y: {
"title": "Quantity"
}
}));
for
(
i
=
0
;
i
<
domain_list
.
length
;
i
+=
1
)
{
queue_list
.
push
(
gadget_list
[
i
+
1
].
render
({
group_by
:
group_by
,
query_by
:
{},
title
:
gadget
.
state
.
title
,
list_method_template
:
gadget
.
state
.
list_method_template
,
list_method
:
gadget
.
state
.
list_method
,
layout
:
{
x
:
{
"
title
"
:
group_by_title
,
"
key
"
:
group_by
,
"
domain_id
"
:
domain_list
[
i
].
domain_id
,
"
domain_list
"
:
domain_list
[
i
].
domain_list
,
"
column_list
"
:
domain_list
[
i
].
column_list
},
y
:
{
"
title
"
:
"
Quantity
"
}
}));
for (i = 0; i < domain_list.length; i += 1) {
queue_list.push(gadget_list[i + 1].render({
group_by: group_by,
query_by: {},
title: gadget.state.title,
list_method_template: gadget.state.list_method_template,
list_method: gadget.state.list_method,
layout: {
x: {
"title": group_by_title,
"key": group_by,
"domain_id": domain_list[i].domain_id,
"domain_list": domain_list[i].domain_list,
"column_list": domain_list[i].column_list
},
y: {
"title": "Quantity"
}
}
}));
}
return RSVP.all(queue_list);
}
});*/
}));
}
return
RSVP
.
all
(
queue_list
);
}
});
}
return
result_queue
;
})
...
...
@@ -1523,10 +1530,14 @@
show_clipboard_action
:
false
});
}
if
(
evt
.
target
.
type
===
"
select-one
"
)
{
// XXX Move it to onEvent > "change" probably
return
gadget
.
changeState
({
"
graphic_type
"
:
evt
.
target
.
value
});
// XXX Move it to onEvent > "change" probably
return
gadget
.
changeState
({
"
graphic_type
"
:
evt
.
target
.
value
});
}
if
((
evt
.
target
.
type
===
'
button
'
)
&&
((
evt
.
target
.
name
===
'
SelectAction
'
)
||
(
evt
.
target
.
name
===
'
ClipboardAction
'
)))
{
console
.
log
(
"
I am here
"
);
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
View file @
a198b99c
...
...
@@ -240,7 +240,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
994.21
450.459.32358
</string>
</value>
<value>
<string>
994.21
596.49508.22784
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -258,7 +258,7 @@
</tuple>
<state>
<tuple>
<float>
16298
44472.66
</float>
<float>
16298
53271.24
</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