Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Dynamically adding optgroup to Select2 with JQuery

Frédéric Tardieu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2015

Hi all,

I'm trying to dynamically add optgroup and options to a Select2: the option is added, but not the optgroup (see http://jsbin.com/lirahekeru/1/edit?html,js,output).

Am I doing something wrong?

Thanks,

Fred

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Volodymyr Krupach
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2015

Hi Frédéric,

Options should be added to the group. Please see the jsbin: http://jsbin.com/nagohevoyi/1/edit

Frédéric Tardieu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 6, 2015

Thanks a lot Volodymyr, Fred

TAGS
AUG Leaders

Atlassian Community Events