Has anyone got to get Editor to work with datalists, and if so, could you share the code please.

Has anyone got to get Editor to work with datalists, and if so, could you share the code please.

worldroamerworldroamer Posts: 10Questions: 3Answers: 0

I am especially interested in the code for the plug-in.

Answers

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin

    When you say a "datalist" could you clarify what you mean please? Is there a specific plug-in you are looking for, such as Select2 or something else?

    Allan

  • worldroamerworldroamer Posts: 10Questions: 3Answers: 0
    edited June 2022

    Hi Allen,
    For Data-entry, I found the select2 dropdown to be too cumberson for the end-users, and switched to using Datalists instead, with much better user acceptance - smoother input.
    "The <datalist> tag specifies a list of pre-defined options for an <input> element. The <datalist> tag is used to provide an "autocomplete" feature for <input> elements. Users will see a drop-down list of pre-defined options as they input data."

  • allanallan Posts: 63,692Questions: 1Answers: 10,500 Site admin

    Oh yes, sorry - I'd forgotten about the datalist tag. I did actually do some research and prototyping for this as apart of the Editor 2 development work back in January 2021. The primary issue I ran into was that the datalist, unlike a select doesn't have a way to have different labels and values. That effectively makes it useless for things like joined data, which you would think would be a natural use for this kind of thing.

    At the time I found this workaround but it doesn't work two labels are the same, which is perfectly reasonable with joined data. It also doesn't allow for a multiple selection like a select tag does.

    As a result, I concluded at the time that the datatable field type would be an effective replacement.

    It would be possible to create a plug-in for Editor to use a datalist, but the limitations are stopping me from making it a core part of the software (which is a real shame - I'd love to have combi-box functionality without external dependencies).

    Allan

Sign In or Register to comment.