I have a set of values that are present on the page loading: eg [1193,1184,2372].
I have a dropdownchecklist which can take a single value like so $(".ddl").dropdownchecklist().val(1193);
When I rebind the dropdownchecklist this selects the value correctly. However I've tried passing my array containing multiple values to the val() method and that doesn't select the values. I kind of expected this. I'm not sure how to best go about preselecting.
I've tried iterating my array to build an filter attribute to apply as the following: $(".ddl [value*='1184'][value*='9067'][value*='14841']").attr('selected','selected');
but this doesn't work. I don't want to have to iterate all the options in the ddl and set them to selected if they match as there are hundreds of options and this won't be good performance wise, especially if there are only 2 options to be preseleted.
Any ideas?