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

Client Side API Not working..

5 Answers 94 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Matthew
Top achievements
Rank 1
Matthew asked on 06 Feb 2009, 05:16 AM
Hello...

No matter what I do, I cannot get the ClearSelection client side method to work.

I keep getting a JScript error.

I have tried every way possible to get this to work including hard coding the full ID.

To make things worse, the combo box is inside of a Radgrid.

Can somebody please give a suggestion..

Matthew..

5 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 06 Feb 2009, 08:36 AM
Hi Matthew,

Which version of RadComboBox are you using? You have posted in the forum of RadComboBox for ASP.NET Ajax however you are using the ClearSelection method which is from RadComboBox classic.

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Matthew
Top achievements
Rank 1
answered on 06 Feb 2009, 01:32 PM
I am using Radcontrols for ASP.NET AJAX... Version Q3.2008 SP1.
if this is a classic method, what method do I use.

Please do not tell me to use AJAX.  I need to have this completely client side because the grid is HUGE, and I am very fluent with javascript.  I did get the box to clear, but I had to get the _input wrapper and clear it there.  I would rather use a method if one exists.

Matthew.
0
Veselin Vasilev
Telerik team
answered on 06 Feb 2009, 01:36 PM
Hello Matthew,

You need to use clearItems() method (note the first letter is lower case).

You can find all public methods of the RadComboBox client object here:
Client-Side Programming > RadComboBox object

Sincerely yours,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Matthew
Top achievements
Rank 1
answered on 06 Feb 2009, 02:14 PM
That did not work... I am sending the code... 

I use the API for other controls in other places, with no problems....

function

setCrewDropDown(checkbox)

{

var controlNumber = checkbox.name.split('$')[4];

 

// get control

 

 

var stringPartner = "ctl00_SearchContent_RadGridRoster_ctl00_" + controlNumber + "_DropDownPartner";

var stringSplit = "ctl00_SearchContent_RadGridRoster_ctl00_" + controlNumber + "_divCbSplit";

var stringStatus = "ctl00_SearchContent_RadGridRoster_ctl00_" + controlNumber + "_RadioButtonListStatus";

var stringButtonReset = "ctl00_SearchContent_RadGridRoster_ctl00_" + controlNumber + "_ButtonReset";

 

 

var ctlPartner = document.getElementById(stringPartner);

var ctlSplit = document.getElementById(stringSplit);

var ctlStatus = document.getElementById(stringStatus);

var ctlButtonReset = document.getElementById(stringButtonReset);

 

 

if(checkbox.checked)

{

ctlSplit.style.display = "";

ctlPartner.style.display="";

 

ctlStatus.style.display = "none";

ctlButtonReset.style.display = "none";

 

}

 

else

 

{

 

 

resetOldPartnerByName(ctlPartner.value);

ctlPartner.style.display = "none";

ctlSplit.style.display = "none";

ctlStatus.style.display = "";

ctlButtonReset.style.display = "";

ctlPartner.clearItems();

 

 

// // Clear combo box selection .. for some reason the Telerik Clientside API does not work!!!!

//

// var stringPartner1 = "ctl00_SearchContent_RadGridRoster_ctl00_" + controlNumber + "_DropDownPartner_Input";

// var ctlPartner1 = document.getElementById(stringPartner1);

// ctlPartner1.value = " "

 

}

 

}

0
Veselin Vasilev
Telerik team
answered on 09 Feb 2009, 04:59 PM
Hello Matthew,

You need to get a reference to the combobox client object by using:

//make sure that stringPartner1 is the correct ID of the combobox !! 
var stringPartner1 = "ctl00_SearchContent_RadGridRoster_ctl00_" + controlNumber + "_DropDownPartner"
 
var combo = $find(stringPartner1); 
combo.clearItems(); 

I hope this helps.

Sincerely yours,
Veselin Vasilev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
ComboBox
Asked by
Matthew
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Matthew
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Share this question
or