I have a flask-admin form, where when user select the topmost dropdown field, certain fields in this form must change into Select2 (dropdown) field. This is what I have so far:
for(var idx in formData.custom_field_chooser)
{
var custom_field = $('#' + idx);
custom_field.select2(); //This generate error
}
I think my code is correct, but that custom_field.select2()
code geneate this error Uncaught query function not defined for Select2 undefined
.
Now, I am sure Select2 has already been included by flask-admin
(cmiiw), but how do we use that?