Reply To: Select2 – style maintenance

#10045307
Support
Keymaster

Hello, to initialize the select2 you need to run this code:

// Select2
(function($) {

	'use strict';

	if ( $.isFunction($.fn[ 'select2' ]) ) {

		$(function() {
			$('[data-plugin-selectTwo]').each(function() {
				var $this = $( this ),
					opts = {};

				var pluginOptions = $this.data('plugin-options');
				if (pluginOptions)
					opts = pluginOptions;

				$this.themePluginSelect2(opts);
			});
		});

	}

}).apply(this, [jQuery]);

Make sure the HTML has all the attributes as our examples.

Kind Regards.