This is a migrated thread and some comments may be shown as answers.

[Solved] javascript error

3 Answers 90 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Mohan
Top achievements
Rank 1
Mohan asked on 18 Apr 2008, 06:59 AM

while executing  command -var

comboItem = new Telerik.Web.UI.RadComboBoxItem();- javascript return an error 'Teleric' is undefined. How can i solv this issue?

3 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 18 Apr 2008, 07:07 AM
Hi Mohan,

Please make sure that the combobox does reside on the page. I am afraid that there is not much more I can suggest without first seeing your files. Can you isolate the problem in a small and running project and attach the files to a new support thread? I will test them locally and try to find a working solution for you.

Regards,
Nick
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Mohan
Top achievements
Rank 1
answered on 18 Apr 2008, 08:23 AM

Hi Kindly find the code below



<%

@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="Deerfield.Matrix.test"%>

<%

@ Register Assembly="RadComboBox.Net2" Namespace="Telerik.WebControls" TagPrefix="radCb" %> 

<!

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<

html xmlns="http://www.w3.org/1999/xhtml">

<script type="text/javascript">

//<![CDATA[

function AddNewItem()

{

var combo = document.getElementById("RadComboBox1");

//combo.set_closeDropDownOnBlur(false);

var intextput = document.getElementById("TextBox1").value;

var comboItem = new Telerik.Web.UI.RadComboBoxItem();

comboItem.set_text(intextput);

combo.trackChanges();

combo.get_items().add(comboItem);

comboItem.select();

combo.commitChanges();

comboItem.scrollIntoView();

return false;
}

</

script>

<

body>

<

form runat="server">

<radCb:RadComboBox ID="RadComboBox1" runat="server">

</radCb:RadComboBox>

<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>&nbsp;

<input id="Button1" type="button" value="button" onclick="Button1_onclick()" />

</

form>

</

body>

</

html>

0
Nikolay
Telerik team
answered on 18 Apr 2008, 10:37 AM
Hi Mohan,

From the combobox declaration, I can see that you are using the classic edition of the control.

The classic edition of the control does not support client-side adding deleting of items. You should use the Telerik.Web.UI.dll and the combobox declaration should be looking, like:

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>



<telerik:RadComboBox ID="RadComboBox1" runat="server" ... />

Regards,
Nick
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox
Asked by
Mohan
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Mohan
Top achievements
Rank 1
Share this question
or