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

Tooltips on dynamically added items

2 Answers 139 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Mehdi
Top achievements
Rank 1
Mehdi asked on 18 Dec 2010, 03:12 PM
Hi.

I have a couple of RADComboBoxes on a page. When a value in the first combo box is selected, the second one is dynamically filled in with values using javascript.

I've been trying to attach image tooltips (via RadToolTip) to items on the second RadComboBox, but I can't seem to find a way to do this. The following code does not work:

var target = $find("<%= ddlTypes.ClientID %>");
 
...
 
item = new Telerik.Web.UI.RadComboBoxItem();
item.set_text("Text1");
item.set_value("Value1");
target.get_items().add(item);
 
var tooltip = $find("<%= RadToolTip1.ClientID %>");
tooltip.set_targetControl(item);

Is there any way to add tooltips to dynamically added items?

Thanks ...

2 Answers, 1 is accepted

Sort by
-1
Accepted
Shinu
Top achievements
Rank 2
answered on 20 Dec 2010, 07:21 AM
Hello Mehdi,

You can try the following client side code to set the ToolTip.

JavaScript:
var item = new Telerik.Web.UI.RadComboBoxItem();
item.set_text("Text1");
item.set_value("Value1");
target.get_items().add(item);
var tooltip = $find("<%= RadToolTip1.ClientID %>");
tooltip.set_targetControl(item.get_element());

Regards,
Shinu.
0
Mehdi
Top achievements
Rank 1
answered on 20 Dec 2010, 08:12 AM
That worked. Thanks for your help :)
Tags
ComboBox
Asked by
Mehdi
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Mehdi
Top achievements
Rank 1
Share this question
or