Fix issues with select inputs

This commit is contained in:
José González 2021-08-24 11:52:37 +02:00
parent b515bfe443
commit 64982ee292
2 changed files with 36 additions and 4 deletions

View File

@ -3043,6 +3043,7 @@ class NetworkMap
$table->data = [];
$table->rowstyle['template_row'] = 'display: none;';
$table->data['template_row']['node_source'] = '';
// Inputs must be not select2, cause duplication make issues.
$table->data['template_row']['interface_source'] = html_print_select(
[],
'interface_source',
@ -3050,7 +3051,21 @@ class NetworkMap
'',
__('None'),
0,
true
true,
false,
true,
'',
false,
false,
false,
false,
false,
'',
false,
false,
false,
false,
false
);
$table->data['template_row']['interface_target'] = html_print_select(
[],
@ -3059,7 +3074,21 @@ class NetworkMap
'',
__('None'),
0,
true
true,
false,
true,
'',
false,
false,
false,
false,
false,
'',
false,
false,
false,
false,
false
);
$table->data['template_row']['node_target'] = '';

View File

@ -965,8 +965,7 @@ function load_interfaces(selected_links) {
$("#relations_table-no_relations").css("display", "none");
$("#relations_table-loading").css("display", "");
var template_relation_row = $("#relations_table-template_row");
template_relation_row.clone();
var template_relation_row = $("#relations_table-template_row").clone;
$(template_relation_row).css("display", "");
$(template_relation_row).attr("class", "relation_link_row");
@ -1114,6 +1113,10 @@ function load_interfaces(selected_links) {
);
$("#relations_table tbody").append(template_relation_row);
// Update input for transform in select2.
$("#interface_source_" + i).select2();
$("#interface_target_" + i).select2();
template_relation_row = null;
});
}