Starting to add new combobox.

This commit is contained in:
Yaro Kasear 2025-08-13 14:08:57 -05:00
parent e149a8d117
commit c9b41b05b2
2 changed files with 9 additions and 4 deletions

View file

@ -73,7 +73,9 @@ create_url = none, edit_url = none, delete_url = none, refresh_url = none
{% for option in options if options %}
<option value="{{ option.id }}">{{ option.name }}</option>
{% endfor %}
{% if not options and refresh_url %}
<option disabled>Loading...</option>
{% endif %}
</select>
{% if refresh_url %}
@ -83,4 +85,4 @@ create_url = none, edit_url = none, delete_url = none, refresh_url = none
</div>
{% endif %}
</div>
{% endmacro %}
{% endmacro %}}

View file

@ -128,11 +128,14 @@
<div class="tab-pane fade show active border border-top-0 p-3" id="inventory-tab-pane">
<div class="row">
<div class="col">
{{ combos.render_combobox(
{{ combos.dynamic_combobox(
id='brand',
options=brands,
label='Brands',
placeholder='Add a new brand'
placeholder='Add a new brand',
create_url=url_for('ui.create_item', model_name='brand'),
edit_url=url_for('ui.update_item', model_name='brand'),
refresh_url=url_for('ui.list_items', model_name='brand'),
delete_url=url_for('ui.delete_item', model_name='brand')
) }}
</div>
<div class="col">