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
in my use case i need to clear also on unselect and clear events
so i added code
$element.on('select2:clear', function (e) {
var name = $(e.currentTarget).attr('name')
$("[data-select2-dependent-fields~='" + name + "']").each(function () {
$(this).val('').trigger('change')
})
})
$element.on('select2:unselect', function (e) {
var name = $(e.currentTarget).attr('name')
$("[data-select2-dependent-fields~='" + name + "']").each(function () {
$(this).val('').trigger('change')
})
})
but probably better is to have this some how configurable
for example by adding to django settings something like
it would be nice to have configurable clearing of dependent field on various events
by now only select event is clearing dependent fields
django-select2/django_select2/static/django_select2/django_select2.js
Line 60 in bfc9313
in my use case i need to clear also on
unselect
andclear
eventsso i added code
but probably better is to have this some how configurable
for example by adding to django settings something like
The text was updated successfully, but these errors were encountered: