Commit 05b9c4af authored by Yusei Tahara's avatar Yusei Tahara

[erp5_web_renderjs_ui] Show select column in view dialog if listbox's select...

[erp5_web_renderjs_ui] Show select column in view dialog if listbox's select column checkbox is checked.
parent 8c11d0dd
...@@ -730,6 +730,7 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None, k ...@@ -730,6 +730,7 @@ def renderField(traversed_document, field, form, value=MARKER, meta_type=None, k
"sort_column_list": sort_column_list, "sort_column_list": sort_column_list,
"editable_column_list": editable_column_list, "editable_column_list": editable_column_list,
"show_anchor": field.get_value("anchor"), "show_anchor": field.get_value("anchor"),
"show_select": field.get_value("select"),
"portal_type": portal_type_list, "portal_type": portal_type_list,
"lines": field.get_value('lines'), "lines": field.get_value('lines'),
"default_params": ensureSerializable(default_params), "default_params": ensureSerializable(default_params),
......
...@@ -131,6 +131,10 @@ ...@@ -131,6 +131,10 @@
return this.getContent(param_list[0]); return this.getContent(param_list[0]);
}) })
.allowPublicAcquisition("getFormDefinition", function getFormDefinition() {
return JSON.parse(JSON.stringify( this.state.form_definition ));
})
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// declared methods // declared methods
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
cell = row.cell_list[j]; cell = row.cell_list[j];
td_element = document.createElement('td'); td_element = document.createElement('td');
if (options.show_line_selector) { if (options.show_line_selector || (options.form_id === 'form_dialog' && options.show_select)) {
if (j === 0) { if (j === 0) {
// If first cell, show a checkbox to select the line // If first cell, show a checkbox to select the line
sub_element = document.createElement('input'); sub_element = document.createElement('input');
...@@ -279,6 +279,8 @@ ...@@ -279,6 +279,8 @@
container = template({ container = template({
"row_list": row_list, "row_list": row_list,
"show_anchor": gadget.state.show_anchor, "show_anchor": gadget.state.show_anchor,
"show_select": gadget.state.show_select,
"form_id": gadget.state.form_id,
"column_list": column_list, "column_list": column_list,
"show_line_selector": gadget.state.show_line_selector, "show_line_selector": gadget.state.show_line_selector,
"show_select_action": gadget.state.show_select_action, "show_select_action": gadget.state.show_select_action,
...@@ -342,6 +344,7 @@ ...@@ -342,6 +344,7 @@
"triggerListboxSelectAction") "triggerListboxSelectAction")
.declareAcquiredMethod("triggerListboxClipboardAction", .declareAcquiredMethod("triggerListboxClipboardAction",
"triggerListboxClipboardAction") "triggerListboxClipboardAction")
.declareAcquiredMethod("getFormDefinition", "getFormDefinition")
////////////////////////////////////////////// //////////////////////////////////////////////
// initialize the gadget content // initialize the gadget content
...@@ -406,7 +409,8 @@ ...@@ -406,7 +409,8 @@
return RSVP.all([ return RSVP.all([
gadget.getUrlParameter(field_json.key + '_begin_from'), gadget.getUrlParameter(field_json.key + '_begin_from'),
gadget.getUrlParameter(field_json.key + '_sort_list:json'), gadget.getUrlParameter(field_json.key + '_sort_list:json'),
gadget.getUrlParameter(field_json.key + '_column_list:json') gadget.getUrlParameter(field_json.key + '_column_list:json'),
gadget.getFormDefinition()
]); ]);
}) })
.push(function (result_list) { .push(function (result_list) {
...@@ -459,6 +463,8 @@ ...@@ -459,6 +463,8 @@
show_anchor: field_json.show_anchor, show_anchor: field_json.show_anchor,
show_stat: field_json.show_stat, show_stat: field_json.show_stat,
show_count: field_json.show_count, show_count: field_json.show_count,
show_select: field_json.show_select,
form_id: result_list[3].pt,
line_icon: field_json.line_icon, line_icon: field_json.line_icon,
query: field_json.query, query: field_json.query,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment