The select2(destroy) method was called on an element that is not using Select2.

0
I receive this error and then a whole bunch of those: RGX.Transaction_NewEdit.dataView1: Unable to destroy:RGX.Contact_Details.autoCompleteForMendix1: Error while uninitialize TypeError: Cannot read property 'destroy' of undefined when closing a complex page with multiple autoCompleteForMendix widgets.  Any idea what the issue is and how to solve or at least troubleshoot?
asked
1 answers
0

Seems like the widgets are still trying to destroy one or several objects that have already been destroyed.

*Edited*
Extracting the widget and opening the .js you will find only one use of .destroy on line 134:

if( this.showLabel ) {
    ...
else {
    dojoClass.remove(this.autoCompleteMainContainer, "form-group");
    dojoConstruct.destroy(this.autoCompleteLabel);
} 

If you debug that part using the inspector, you might be able to solve it.

Of course, since this is debugging someone else's code, you can also try asking the creator. Do so by adding an issue to the github-project. He will appreciate it moer if you solve it yourself and add a pullrequest.

answered