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

RadComboBox:How to get current selected item tooltip using javascript or jquery

5 Answers 296 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
sandeep
Top achievements
Rank 1
sandeep asked on 02 Jul 2014, 03:32 PM
Want to get the tooltip of a current selected item in radcombobox

5 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 03 Jul 2014, 03:38 AM
Hi sandeep,

Please try the below sample code snippet to achieve your scenario.

ASPX:
<telerik:RadComboBox ID="rcboTestItems" runat="server" EmptyMessage="--select--"
    OnClientSelectedIndexChanged="showToolTip">
    <Items>
        <telerik:RadComboBoxItem Text="Item1" />
        <telerik:RadComboBoxItem Text="Item2" />
        <telerik:RadComboBoxItem Text="Item3" />
    </Items>
</telerik:RadComboBox>

JavaScript:
function showToolTip(sender, args) {
    sender._element.title = args._item._text;
}

Thanks,
Princy.
0
sandeep
Top achievements
Rank 1
answered on 03 Jul 2014, 07:20 AM
Hi Princy: Thanks for the reply 
I think we are trying to assign a tool tip to the rad combo box item,but i have already given the tool tips for rad combo box items from code behind .Here i want to get that tool tip value of the current selected item as an alert,through java script... 
0
sandeep
Top achievements
Rank 1
answered on 03 Jul 2014, 07:35 AM
Please check the image, i want to get the "All other formats " through java script or j query.As in image  all other items have their own tool tips , i want to get those corresponding tool tip value when that respective item is selected,and display it as an alert.

Thanks
0
Accepted
Princy
Top achievements
Rank 2
answered on 04 Jul 2014, 02:41 AM
Hi Sandeep,

Please try the below sample code snippet which works fine at my end.

ASPX:
<telerik:RadComboBox ID="rcboTestItems" runat="server" EmptyMessage="--select--"
    OnClientSelectedIndexChanged="showToolTip">
    <Items>
        <telerik:RadComboBoxItem Text="Images" ToolTip="Images" />
        <telerik:RadComboBoxItem Text="Other" ToolTip="All other formats" />
        <telerik:RadComboBoxItem Text="PDF" ToolTip="Pdf" />
    </Items>
</telerik:RadComboBox>

JavaScript:
function showToolTip(sender, args) {
    alert("Selected Item ToolTip " + args.get_item().get_element().title);
}

Please provide your code if it doesn't help.
Thanks,
Princy.
0
sandeep
Top achievements
Rank 1
answered on 07 Jul 2014, 06:54 PM
Thank you Princy
Tags
ComboBox
Asked by
sandeep
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
sandeep
Top achievements
Rank 1
Share this question
or