You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem: The django-tomselect package currently provides excellent integration of the Tom Select library with Django forms. However, it lacks support for Django formsets / using with multiple of the same form
Current Issue:
let wasReset{{ widget.name }} = false; var {{ widget.name }} = new TomSelect(..., config);
Issue 1: It looks to be an issue with the way variable names are being set from the the widget.name rendering '-' which is causing the JS to break Proposed solution: Perhaps add property onto the model to be used only for the variable names that replaces dashes -> underscores
Issue 2: It should also be able to handle copying the formset.empty_form which should initialize the widgets Proposed solution: Honestly not sure how one would go about this
Issue 3: I've tried loading my forms independently using HTMX, this also does not work since having multiple of the same form Tomselect cannot differentiate between them i.e I have a button that adds a new form dynamically, the first form initializes correctly, when I add another form Tomselect cannot initialize it correctly. Proposed solution: Perhaps initializing the Tomselects with a UUID of some kind using data attributes
The text was updated successfully, but these errors were encountered:
Problem: The
django-tomselect
package currently provides excellent integration of the Tom Select library with Django forms. However, it lacks support for Django formsets / using with multiple of the same formCurrent Issue:
let wasReset{{ widget.name }} = false;
var {{ widget.name }} = new TomSelect(..., config);
Issue 1: It looks to be an issue with the way variable names are being set from the the
widget.name
rendering '-' which is causing the JS to breakProposed solution: Perhaps add property onto the model to be used only for the variable names that replaces dashes -> underscores
Issue 2: It should also be able to handle copying the
formset.empty_form
which should initialize the widgetsProposed solution: Honestly not sure how one would go about this
Issue 3: I've tried loading my forms independently using HTMX, this also does not work since having multiple of the same form Tomselect cannot differentiate between them i.e I have a button that adds a new form dynamically, the first form initializes correctly, when I add another form Tomselect cannot initialize it correctly.
Proposed solution: Perhaps initializing the Tomselects with a UUID of some kind using data attributes
The text was updated successfully, but these errors were encountered: