Uploaded image for project: 'Clowder'
  1. Clowder
  2. CATS-604

Search in pull down menus adds <option> without attributes

XMLWordPrintableJSON

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • Old Issues
    • None
    • GUI, Metadata, Search
    • None

      An unsuccessful search in pull down menus adds <option></option> after Enter in Add Metadata and other Add menus such as Add Space in New dataset. The attributes for the option are not added leading to errors.
      The problem is in customized chosen.js in key mapping which adds only the options. The solutions are:
      1) use clean chosen.js for certain pull down menus, add proper attributes to new options
      2) switch to select2 and retire chosen. Add attributes in js code.
      Add 2. preferable, select2 seems to be better maintained. With select2 filtering by title/name should be done on the server side (implemented chosen does it on the client side which I think is fine for small number of items).
      the endpoints (getMetadata) would have to be changed, see Add space pull down menu for examples of passing title/name parameter. On the other side, I don't like select2 ajax calls with no (easy) calls for done and fail errors. It uses jQuery ajax.transfer which is a pain. Also json must have id and text, there has to be some mapping from a custom return json. Mapping is necessary for option attributes and data object See attachment for addMetadata.scala.html where I implemented functional select2 Note, there are no new endpoints (url) and some metadata types don't work in response.

              Unassigned Unassigned
              mondrejc Michal Ondrejcek
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Estimated:
                  Original Estimate - 1 day
                  1d
                  Remaining:
                  Remaining Estimate - 1 day
                  1d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified