Hi
I am trying to use the Telerik ComboBox control and it keeps throwing me "stop running this script". This happens whenever I select the item from the dropdown or while typing and changing on the combo inputbox. I have read the performance optimization telerik web article but that has not helped me in anyway. At any given time the number of combo items could be around 1500 - 2000.
I have added the Telerik RadComboBox control as below,
<telerik:RadComboBox ID="radComboCityNames" runat="server" EnableLoadOnDemand="true" OnClientBlur="" OnClientFocus=""
OnClientItemsRequesting = "StopRequest" onitemsrequested="radComboCityNames_ItemsRequested" skin="Default"
MarkFirstMatch="false" AutoPostBack="false" EnableItemCaching="true" EnableEmbeddedScripts="false" EnableViewState = "false">
</telerik:RadComboBox>
And on the ItemsRequested handler I have coded as follows,
RadComboBox combobox = (RadComboBox)sender;
string text = string.Format("{0}%", e.Text);
DataTable dat = dt.GetCityNamesTable(1, text);
combobox.DataTextField = "cityname";
combobox.DataSource = dat;
combobox.DataBind();
Script used ,
function StopRequest(combobox) {
var combo = $find("<%=radComboCityNames.ClientID %>");
if (combo.get_text().length < 1) {
combo.hideDropDown();
return false;
}
else {
return true;
}
}
Your assistance is much appreciated. It seems may people have raised this but none has got a proper solution.! :(
I am trying to use the Telerik ComboBox control and it keeps throwing me "stop running this script". This happens whenever I select the item from the dropdown or while typing and changing on the combo inputbox. I have read the performance optimization telerik web article but that has not helped me in anyway. At any given time the number of combo items could be around 1500 - 2000.
I have added the Telerik RadComboBox control as below,
<telerik:RadComboBox ID="radComboCityNames" runat="server" EnableLoadOnDemand="true" OnClientBlur="" OnClientFocus=""
OnClientItemsRequesting = "StopRequest" onitemsrequested="radComboCityNames_ItemsRequested" skin="Default"
MarkFirstMatch="false" AutoPostBack="false" EnableItemCaching="true" EnableEmbeddedScripts="false" EnableViewState = "false">
</telerik:RadComboBox>
And on the ItemsRequested handler I have coded as follows,
RadComboBox combobox = (RadComboBox)sender;
string text = string.Format("{0}%", e.Text);
DataTable dat = dt.GetCityNamesTable(1, text);
combobox.DataTextField = "cityname";
combobox.DataSource = dat;
combobox.DataBind();
Script used ,
function StopRequest(combobox) {
var combo = $find("<%=radComboCityNames.ClientID %>");
if (combo.get_text().length < 1) {
combo.hideDropDown();
return false;
}
else {
return true;
}
}
Your assistance is much appreciated. It seems may people have raised this but none has got a proper solution.! :(