nav100
nav100

Reputation: 411

hide and show RadComboBox

I am trying to hide and Show RadcomboBox. But it doesn't seem to be working.

$.ajax({ 
            url: applicationPath + "/test/Test.svc/GetResultById", 
            type: "POST", 
            dataType: "json", 
            data: '{"sId":' + sender.get_value() + '}', 
            contentType: "application/json; charset=utf-8", 
            success: function(result) 
             { 
                  var combo = "<%= RadComboBox1.ClientID %>");

                  if(result.d == false) 
                  { 

                    combo.hideDropDown(); 
                  } 
                  else
                  {
                    combo.showDropDown();
                  }
             }       

Upvotes: 1

Views: 3118

Answers (4)

Michael
Michael

Reputation: 311

hideDropDown and showDropDown only closes and opens it. See the reference here

If you actually want to hide the drop down on the client site you will need to get a reference to the combo box and then do this (see here too):

combo.set_visible(false)

Upvotes: 0

Somnath Kharat
Somnath Kharat

Reputation: 3600

Use $find to RadComboBox See here

var combo = $find("<%= RadComboBox1.ClientID %>");

to Hide the RadComboBox dropdown

combo.hideDropDown();

TO Show RadComboBox dropdown

combo.showDropDown();

Upvotes: 1

nav100
nav100

Reputation: 411

It's working with combo.set_visible(false);

Upvotes: 0

Yaakov Ellis
Yaakov Ellis

Reputation: 41490

According to this page, you should identify your combo with the following code:

var combo = <%= RadComboBox1.ClientID %>; 

So maybe try losing the quotation marks and the closing parentheses (which probably shouldn't be there anyway) on that row.

Also, ShowDropDown() and HideDropDown() begin with capital letters.

If you are still running into problems, try running it in FireBug with the Javascript debugger turned on (or even just put in Alert() calls to test and make sure that the script gets all the way through without any errors and is properly identifying the combo object).

Upvotes: 0

Related Questions