1

I'm using Fomantic-UI, and I have a simple searchable dropdown.

<div id="form_selection" class="ui fluid search selection three column dropdown">
    <input type="hidden" name="country">
    <i class="dropdown icon"></i>
    <div class="default text">Select Form</div>
    <div class="menu">
        <repeat group="{{ @forms }}" value="{{ @form }}">
            <div class="item" data-meta="{{ implode(', ', array_column(@form['categories'], 'category')) }}" data-value="{{ @form['uid'] }}">{{ @form['name'] }}</div>
        </repeat>
    </div>
</div>

This dropdown is initialized like this:

$('#form_selection').dropdown({
    ignoreDiacritics: true,
    sortSelect: true,
    fullTextSearch:'exact'
});

This loops through some rows in my database, which adds some options to my dropdown. For each of these values, there is 1 or more Category's associated with it. As you can see, I have an attribute called data-meta. I want the search within the dropdown to include the data-meta attribute in it's returns (Similar to DataTables data-search option).

Is there any way to do this?

GrumpyCrouton
  • 8,486
  • 7
  • 32
  • 71

0 Answers0