{% extends '_includes/forms/autosuggest' %} {% block data %} {{ parent() }} this.updateSuggestions() {% endblock %} {% block methods %} {{ parent() }} updateSuggestions() { Craft.postActionRequest('webhooks/webhooks/class-suggestions', {}, $.proxy(function(response, textStatus) { if (textStatus === 'success') { this.suggestions = [ { data: response.classes } ]; } }, this)); }, onSelected(option) { this.selected = option.item; // Trigger a 'change' event var input = this.$el.childNodes[0].childNodes[0]; jQuery(input).trigger('change'); }, {% endblock %}