style the option text with a line break

192 views
Skip to first unread message

bora.in...@gmail.com

unread,
Aug 27, 2015, 10:30:26 AM8/27/15
to select2
Hi guys,

I am looking for a way to style the option text, specifically to add line breaks to the option value and display them like here:

http://jsfiddle.net/fnagel/GXtpC/light/

Like example 3 and 5.

Is it possible with select2 and how?

thanks,
Bora

Kevin Brown

unread,
Aug 27, 2015, 11:57:35 AM8/27/15
to select2
Select2 supports custom rendering of options with the `templateResult` and `templateSelection` methods. You can find examples in the documentation ("Templating" and "Remote data source").


--
You received this message because you are subscribed to the Google Groups "select2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to select2+u...@googlegroups.com.
To post to this group, send email to sel...@googlegroups.com.
Visit this group at http://groups.google.com/group/select2.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages