2023-01-05 12:19:39 +00:00
|
|
|
function format(state) {
|
|
|
|
if (!state.id) return state.text;
|
|
|
|
return "<img class='flag' src='img/flags/" + state.id.toLowerCase() + ".png'/> " + state.text;
|
|
|
|
}
|
|
|
|
|
2023-01-24 10:05:16 +00:00
|
|
|
var placeholder = "Select a State";
|
2023-01-05 12:19:39 +00:00
|
|
|
$('.select2, .select2-multiple').select2({
|
|
|
|
theme: "bootstrap",
|
|
|
|
placeholder: placeholder,
|
|
|
|
});
|
|
|
|
$("#selitemIcon").select2({
|
|
|
|
theme: "bootstrap",
|
|
|
|
templateResult: format,
|
|
|
|
formatSelection: format,
|
|
|
|
escapeMarkup: function(m) {
|
|
|
|
return m;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$('.select2-allow-clear').select2({
|
|
|
|
theme: "bootstrap",
|
|
|
|
allowClear: true,
|
|
|
|
placeholder: placeholder
|
|
|
|
});
|
|
|
|
|