Unable to select a result from the select2 search results

后端 未结 4 969
庸人自扰
庸人自扰 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:14

    I have faced the same issue,other solution for this issue is:-

    In your response object(In above response Product details object) must have an "id" as key and value for that.

    Example:- Your above given response object must be like this

    {"id":"1","productName":"samsung galaxy s3","manufacturer":"Samsung","productOptions":"Color;Memory","productOptiondesc":"Silver;32GB"}

    SO you don't need this id: function(object){return object.key;}

提交回复
热议问题