Unable to select a result from the select2 search results

后端 未结 4 960
庸人自扰
庸人自扰 2020-12-06 11:05

I am using the select2 for on of my search boxes. I\'m getting the results from my URL but I\'m not able to select an option from it. I want to use the \'product.productName

4条回答
  •  庸人自扰
    2020-12-06 11:13

    You are missing id attribute for result data. if it has not, it makes option "unselectable".

    Example:

                $('#e7').select2({
                        id: function(e) { return e.productName; },
                });
    

提交回复
热议问题