ontoportal / ontoportal_web_ui

Frontend Rails-based web application for OntoPortal
https://ontoportal.org
Other
3 stars 30 forks source link

form_complete.js #20

Open paulsonak opened 2 months ago

paulsonak commented 2 months ago

Hi there,

I am building a new Django app (using jQuery 3.7.1) and hoping to implement some of the widgets you have available for form_complete and a tree view for ontologies.

Specifically, I have included in my .html form in the header:

<script src="{% static 'common/js/form_complete.js' %}" type="text/javascript"></script>

and this is the text input:

<div class "row mt-3">
    <div class="col-6">
        <label for="target_disease" class="form-label small">Target Disease</label>
        <input id="target_disease" name="target_disease" class="bp_form_complete-BAO-uri" type="text">
    </div>
</div>

The error I get is:

Uncaught (in promise) TypeError: jQuery(...).bioportal_autocomplete is not a function
    at HTMLInputElement.<anonymous> (form_complete.js:295:18)
    at Function.each (jquery-3.7.1.min.js:2:3129)
    at e.fn.init.each (jquery-3.7.1.min.js:2:1594)
    at formComplete_setup_functions (form_complete.js:235:46)
    at form_complete.js:100:7

It looks like the form_complete.js tries to work with jQuery 1.X and use the 1.X migrate tool which isn't applicable to migrate to jQuery 3.X.

Is it possible to update the form_complete.js to work with jQuery 3.X?

Thank you!

jonquet commented 2 months ago

Hello Amanda, these widgets are not super recent... are you using them to query BioPortal or another instance of OntoPortal .? Maybe @Bilelkihal or @jvendetti in the team can help you.

paulsonak commented 2 months ago

Hi, thanks for looping them in! Yes I’m trying to query bioportal, the BAO ontology. I saw that the form_complete.js was forked directly from ontoportal so I don’t know if either team has an updated version, but it would be great if so!