Hi Luis,
Thank you for your update.
Query 1: The first time I run your sample, I need to click twice in order to show popup. The popup must show or hidden when I click only once.
Response: You can use the showPopup method to show popup in the click function, once we have added the “No item” element. Kindly refer to the following code snippet.
$("#skillsets_container").on('click',function(){
var obj=$("#skillsets").data("ejDropDownList");
if(obj.model.dataSource=="")
{
obj.popupListItems = noitem;
obj.ultag.empty();
obj._isPlainType(obj.popupListItems) ? obj._plainArrayTypeBinding(noitem) :
obj._objectArrayTypeBinding(noitem, "search");
if (obj.ultag.find("li").length == 1) {
obj.ultag.find("li").eq(0).addClass("e-disable");
}
obj.inputSearch.attr("readonly","");
}else{
obj.inputSearch.removeAttr("readonly");
}
obj.showPopup();
}); |
Query 2: Once I insert any character into search input and then delete it, after that I can select the text "No Items" as you can see in the next image. This text mustn't be selected.
Response: We have modified the previous solution, instead of adding “No items” element using dataSource. We have directly added it to the popup list. so, if there are no items in the dataSource then you can make the search input to readonly.
Regards,
Prince