How to Set Selected value in Multi-Value Select in Jquery-Select2.?

后端 未结 14 913
轻奢々
轻奢々 2020-12-01 01:41

hi all i am binding my dropdown with Jquery-Select2. Its working fine but now i need to Bind my Multi-Value selectBox by using Jquery-Select2.

M

14条回答
  •  抹茶落季
    2020-12-01 01:41

    you can add the selected values in an array and set it as the value for default selection

    eg:

    var selectedItems =[];
    selectedItems.push("your selected items");
    ..
    $('#drp_Books_Ill_Illustrations').select2('val',selectedItems );
    

    Try this, this should definitely work!

提交回复
热议问题