Hello,
I am trying to dynamically delete and all the items in a combobox and then reload it with new items. Here is the code,
I am trying to dynamically delete and all the items in a combobox and then reload it with new items. Here is the code,
function addNewItems(selectRef, optionsArray, valuesArray)
{
var combo = document.getElementById("ddlVehicleMake_Input");
combo.get_items().clear();
for (var idx = 0; idx < optionsArray.length; idx++) {
if (valuesArray == "")
{
var comboItem = new Telerik.Web.UI.RadComboBoxItem();
comboItem.set_text(optionsArray[idx]);
combo.trackChanges();
combo.get_items().add(comboItem);
} else { var comboItem = new Telerik.Web.UI.RadComboBoxItem();
comboItem.set_text(optionsArray[idx]);
combo.trackChanges();
combo.get_items().add(comboItem);
} }
combo.commitChanges(); }
It fails at combo.get_items().clear(); throwing an error that method is not supported by the object. I think making the following reference should be enough.
Am I missing any references? OR how do I go about it?
Thanks!