$('#dropdown1').ejDropDownList({
dataSource: skillset,
fields: { text: "skill" },
headerTemplate: "<div class='temp' id='unselect' >Unselect Item</div>"
});
$("#unselect").on("click", function() {
var obj = $("#dropdown1").data("ejDropDownList");
obj.setModel({ selectedIndex : -1 });
}); |
orobj.selectItemsByIndices("-1");
insteads ofobj.selectItemByValue(null);
obj.setModel({ selectedIndex : -1 });
$("#unselect").on("click", function() {
var obj = $("#dropdown1").data("ejDropDownList");
obj.setModel({ selectedIndex : -1 });
obj._trigger("change",obj);
}); |