FIX : Linked extrafields list
This commit is contained in:
parent
6bbc25e8c3
commit
645685d16e
@ -6568,15 +6568,30 @@ abstract class CommonObject
|
|||||||
var parent = $(this).find("option[parent]:first").attr("parent");
|
var parent = $(this).find("option[parent]:first").attr("parent");
|
||||||
var infos = parent.split(":");
|
var infos = parent.split(":");
|
||||||
var parent_list = infos[0];
|
var parent_list = infos[0];
|
||||||
showOptions(child_list, parent_list);
|
//Hide daughters lists
|
||||||
|
if ($("#"+child_list).val() == 0 && $("#"+parent_list).val() == 0){
|
||||||
/* Activate the handler to call showOptions on each future change */
|
$("#"+child_list).hide();
|
||||||
|
//Show mother lists
|
||||||
|
} else if ($("#"+parent_list).val() != 0){
|
||||||
|
$("#"+parent_list).show();
|
||||||
|
}
|
||||||
|
//show the child list if the parent list value is selected
|
||||||
|
$("select[name=\""+parent_list+"\"]").click(function() {
|
||||||
|
if ($(this).val() != 0){
|
||||||
|
$("#"+child_list).show()
|
||||||
|
}
|
||||||
|
});
|
||||||
$("select[name=\""+parent_list+"\"]").change(function() {
|
$("select[name=\""+parent_list+"\"]").change(function() {
|
||||||
showOptions(child_list, parent_list);
|
showOptions(child_list, parent_list);
|
||||||
|
//Select the value 0 on child list on change on the parent list
|
||||||
|
$("#"+child_list).val(0).trigger("change");
|
||||||
|
//Hide child lists if the parent value is set to 0
|
||||||
|
if ($(this).val() == 0){
|
||||||
|
$("#"+child_list).hide();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setListDependencies();
|
setListDependencies();
|
||||||
});
|
});
|
||||||
</script>'."\n";
|
</script>'."\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user