How to append jquery select2 values with initSelection

后端 未结 1 524
失恋的感觉
失恋的感觉 2021-01-21 11:44

Here is my select2 multiple select with ajax.

Initially i am setting some values in the initselection like this

initSelection : function (element, callba         


        
相关标签:
1条回答
  • 2021-01-21 12:11

    In processResults method you need to add your initial data in return:

    data.items[data.items.length] = initialdata; results: data.items

    initialdata has to be in global/object scope.

    0 讨论(0)
提交回复
热议问题