Hi I'm trying to clear a webdropdown with multiple selection enabled and am running into issues.
I am using the suggested javascript to accomplish this from the following Infragistics form post http://ko.infragistics.com/community/forums/t/73252.aspx, but the code does not appear to work.
I've debugged the code in Chrome's javascript debugger and did not see any errors. I was wondering if there were any other approaches I could try.
I looks like this image doesn't fit into the form post, go to https://lh6.googleusercontent.com/-Q1sNknECRDQ/URjg1YrYqbI/AAAAAAAABtQ/rn4HafzkGkw/s671/ClientSideClearingIssue.jpg in order to view the entire image
I figured out how to resolve this issue. The Infragistics form answer I mentioned above suggests calling set_currentValue('', true), and then iterate thru selected items and unselect and unactivate them. It appears that you want to call set_currentValue("",true) after selecting/unactiving items. If you do this before, it will not work as expected.
function ClearWebDropDown(name) {
var dropDown = $find(name);
if (dropDown != null) {
for (var i = 0; i < dropDown.get_items().getLength(); i++) {
dropDown.get_items().getItem(i).unselect();
dropDown.get_items().getItem(i).inactivate();
}
dropDown.set_currentValue('', true);
} else {
alert("Error:could not find drop down:" + name);