I'm trying to loop through some widgets by class ID to add some additional configuration. Suppose I have the mark up below with the following script . . . how do I get widgets by class?
<input id="afCity1" name="City1" data-bind="value: dataEntryItem.City1" class="afCityDropDown" />
<input id="afCity2" name="City2" data-bind="value: dataEntryItem.City2" class="afCityDropDown" />
<input id="afCity3" name="City3" data-bind="value: dataEntryItem.City3" class="afCityDropDown" />
<input id="afState1" name="State1" data-bind="value: dataEntryItem.State1" class="afStateDropDown" />
<input id="afState2" name="State2" data-bind="value: dataEntryItem.State2" class="afStateDropDown" />
. . .
// this works no problem
$(".afCityDropDown").kendoDropDownList({
optionLabel: " ",
height: 150,
autoBind: false
});
. . .
$(".afCityDropDown").each(function () {
// this doesn't work
$(this).data("kendoDropDownList").setDataSource(dataReturned);
});