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

How do I clear the RADComboBox via JQuery

4 Answers 93 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Ray
Top achievements
Rank 1
Ray asked on 29 Mar 2011, 01:51 AM
I'm trying to clear or reset the RAD ComboBox via JQuery and I just can't seem to find the right way to do it. I'm firing a click event on a radiobuttonlist that I would like to set the RADComboBox to nothing.I get into my click even, but that combobox just wont play nice. Here are the ways I have tried it...

$('#<%=Me.cboCounterParty.ClientID %>').val("");
$('#<%=Me.cboCounterParty.ClientID %>').val([]);
$telerik.$('#<%=Me.cboCounterParty.ClientID %>').val("");
$telerik.$('#<%=Me.cboCounterParty.ClientID %>').val([]);


On a side note I am able to pull what's in the combobox via
alert($telerik.$('#<%=Me.cboCounterParty.ClientID %>').val());

Thanks!

4 Answers, 1 is accepted

Sort by
0
Ray
Top achievements
Rank 1
answered on 29 Mar 2011, 11:31 PM
var d = $find('<%=Me.cboCounterParty.ClientID %>');
d.clearItems();
d.set_text("");
0
Calleigh
Top achievements
Rank 1
answered on 30 Mar 2011, 09:33 AM
You have to use:  var combo = $find("<%= cboCounterParty.ClientID %>");
to get the RadComboBox client-side object.
0
Matt
Top achievements
Rank 1
answered on 30 May 2013, 03:15 PM
I know that this post is old but for anyone else who finds it...

All I get is "Error: Object doesn't support property or method..."

So far, I have yet to find any current documentation and working links... this functionality must be a myth.
0
Hristo Valyavicharski
Telerik team
answered on 04 Jun 2013, 11:34 AM
Hi Matt,

The suggested code is working, but it cannot be used with enabled LoadOnDemand feature. I'm attaching small sample which shows how to use this code.

Regards,
Hristo Valyavicharski
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
ComboBox
Asked by
Ray
Top achievements
Rank 1
Answers by
Ray
Top achievements
Rank 1
Calleigh
Top achievements
Rank 1
Matt
Top achievements
Rank 1
Hristo Valyavicharski
Telerik team
Share this question
or