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

Disabling ComboBox on the Client Doesn't Change Appearance

1 Answer 53 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Brian Mains
Top achievements
Rank 1
Brian Mains asked on 08 Apr 2010, 06:23 PM
Hello,

I'm trying to disable the combo box on the client, and having it look disabled (using the italicized font, which I have been able to setup).  I manually invoke the requesting of items from the web service, and on the itemsrequested client-side event, I do this:

function

 

itemsRequested(sender, e) {

 

 

  if (sender.get_items().get_count() == 0) {

 

       sender.set_enabled(

false);

 

 

        return;

 

  }

}

This actually runs, but the UI of the combo doesn't change to the new style...  do I have to programmably do it?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Kalina
Telerik team
answered on 14 Apr 2010, 03:22 PM
Hello Brian Mains,

I can suggest you disable RadComboBox at the client using disable() method.

If you prefer to modify some of the style properties of the RadComboBox at its "disabled" state, you can follow this approach:
function itemsRequested(sender, e) {
 
    if (sender.get_items().get_count() == 0) {
     
        sender.disable();
        var inputArea = sender.get_inputDomElement();
        inputArea.style.color = "gray";
        inputArea.style.backgroundColor = "#cccccc";
        inputArea.style.fontWeight = "bold";
         
        return;
    }
 
}

Please let me know if this was helpful.

Regards,
Kalina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
ComboBox
Asked by
Brian Mains
Top achievements
Rank 1
Answers by
Kalina
Telerik team
Share this question
or