Refactor ComboBoxWidget; enhance createOption and sortOptions functions, update onAdd parameter in render_combobox macro for improved usability and maintainability

This commit is contained in:
Yaro Kasear 2025-06-20 11:55:36 -05:00
parent b182e30c43
commit 3c9806bd34
3 changed files with 62 additions and 19 deletions

View file

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