yourlabs / django-autocomplete-light

A fresh approach to autocomplete implementations, specially for Django. Status: v4 alpha, v3 stable, v2 & v1 deprecated.
https://django-autocomplete-light.readthedocs.io
MIT License
1.8k stars 467 forks source link

Add event to notify of the initialization completed #1246

Closed andreccorrea closed 2 years ago

andreccorrea commented 3 years ago

Creates and dispatches the event "dal-element-initialized" to notify of the element initialization completed.

Usage:

$(document).on("dal-element-initialized", function(e) {
    $(`#${e.detail.element.id}`).select2('open').trigger('focus')
});
jpic commented 3 years ago

Hi,

Is it possible to mention this in the documentation?

Thanks

andreccorrea commented 3 years ago

Updated JS docs tutorial with initialization event (dal-element-initialized) example.