Created
June 30, 2016 09:29
-
-
Save e-vural/b7f08cf92536459f14b91c51a92b4aba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".js-data-example-ajax").select2({ | |
width:"off", | |
placeholder: '{% trans from "content" %}content.select.placeholder{% endtrans %}', | |
language: "{{ app.request.getLocale() }}", | |
templateResult: function (data) { | |
if (!data.element) { | |
return data.text; | |
} | |
var $element = $(data.element); | |
var $wrapper = $('<span></span>'); | |
$wrapper.addClass($element[0].className); | |
var style = $element.attr('style'); | |
$wrapper.attr('style',style); | |
$wrapper.text(data.text); | |
return $wrapper; | |
}, | |
theme: "bootstrap" | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment