Refactor combo box integration; streamline onAdd, onRemove, and onEdit parameters in render_combobox macro for improved functionality and readability

This commit is contained in:
Yaro Kasear 2025-06-20 10:02:40 -05:00
parent d3a9b6dbd5
commit b182e30c43
3 changed files with 71 additions and 26 deletions

View file

@ -24,9 +24,9 @@
<script>
document.addEventListener('DOMContentLoaded', () => {
ComboBoxWidget.initComboBox("{{ id }}", {
{% if onAdd %}onAdd: {{ onAdd }},{% endif %}
{% if onRemove %}onRemove: {{ onRemove }},{% endif %}
{% if onEdit %}onEdit: {{ onEdit }}{% endif %}
{% if onAdd %}onAdd: function(option) { {{ onAdd | safe }} },{% endif %}
{% if onRemove %}onRemove: function(option) { {{ onRemove | safe }} },{% endif %}
{% if onEdit %}onEdit: function(option) { {{ onEdit | safe }} }{% endif %}
});
});
</script>