Support » Fixing WordPress » 2 column select list. Sort by column

  • blogdropper

    (@blogdropper)


    Hi, I’m creating a multilingual web-site for Middle East medicinal plants in Arabic, Hebrew and English.
    I have the plant names in each language and also the phonetic spellings for the Hebrew and Arabic names.
    I want to make a 2 column select (combo) list with the phonetic spelling on the left and the Arabic/Hebrew on the right, with 2 radio buttons at the top to select which column is sorted and then select from the list.
    Hope what I want to do is clear, appreciate any suggestions, code snippets or plugins, to help me do this.
    Thanks
    David

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    There is no form field in HTML that would do that, so you’re left with creating regular HTML content and the styling it to look like a combo box and using JavaScript to mimic the UI functionality. There are basic examples available by searching. You’re probably on your own for the specifics.

    blogdropper

    (@blogdropper)

    Hi, Thanks for the reply.
    I’m using Chosen for WordPress
    which gives a pretty Select box. Do you think it’s possible to adapt it to what I need?
    My Jquery skills are pretty limited.

    Thanks
    David

    Moderator bcworkz

    (@bcworkz)

    Well, possible and practical are two different things. It’s likely possible. Modification of packaged libraries like that is impractical in my experience. Maybe you could code the HTML implementation and Chosen would be able to alter the appearance of whatever HTML is generated.

    What I fear is that such a scheme will get so complicated that it will be difficult to achieve. While what you are after is a cool, slick UI for sure, I wonder if you would be better off with something a bit more clunky that will actually be doable without a lot of difficulty.

    The thing is, you cannot really have two columns in these things. You end up with rows of text that look like multiple columns, but are really a single column. Such data would be difficult to sort by the second column. I think the entire HTML would need to be dynamically generated for every sort from an underlying data object. It might be more practical to sort columns in a table. The table could be within a smaller scrollable container to give the appearance of an Excel list box. I know I’ve seen jQuery plugins that do sortable tables. Sortable columns in a form element, not so much.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.