lcdsantos/jQuery-Selectric

Custom class for "multiple" select

BitchCO opened this issue · 1 comments

Can you add an option to have custom class if the select element is multiple select?

Maybe something like this?

multiple: {
  customClass: 'my_custom_css_class',       // Type: String. Description: Name of the custom class.
  separator: ', ',       // Type: String. Description: Items separator.
  keepMenuOpen: true,    // Type: Boolean. Description: Close after an item is selected.
  maxLabelEntries: false // Type: Boolean or Integer. Description: Max selected items do show.
}

At the moment, there is no way to make a difference in CSS between "normal" and "multiple" select

That is already possible. Selectric will keep all classes which are assigned to the native select element.

For example:

<select class="bottom-spacer is-multiple">
    <!-- <options> -->
</select>

… becomes

<div class="selectric-wrapper selectric-bottom-spacer selectric-is-multiple">
    <!-- more generated markup -->
</div>

Selectric will add also a configurable prefix.

customClass: {
      prefix: 'selectric', // Type: String.  Description: Prefixed string of every class name.
      camelCase: false     // Type: Boolean. Description: Switch classes style between camelCase or dash-case.
},