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

RadEditor Drop Down text

2 Answers 77 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 17 May 2010, 03:16 AM
Hi,

I'm using a dropdown inside the RadEditor tool strip.  I see from the examples how to get the value of the dropdown and how to get the name of the command, but how do i get the text of the drop down in this example?

Thanks!

        function OnClientCommandExecuting(editor, args) { 
            var name = args.get_name(); //The command name 
            var val = args.get_value(); //The drop down value 
 

Here's an example of what I mean;

        <telerik:EditorToolGroup>     
            <telerik:EditorDropDown Name="Test" Width="150px" Text="Insert Test" ItemsPerRow="1" PopupWidth="170px" PopupHeight="117px"
                <telerik:EditorDropDownItem Name="Text 1" value="T1"/> 
 

I want to get "Text 1" but the only thing I can figure out to get is T1.


2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 May 2010, 09:46 AM

Hello Chris,

Try the following approach in order to get the selecteditem text in the OnClientCommandExecuting handler.

JavaScript:

 
<script type="text/javascript">  
    function OnClientCommandExecuting(sender, args) {  
        var text = args.get_tool().get_items()[args.get_tool().get_selectedIndex()][1];  
        alert(text);  
    }  
</script> 

-Shinu.

0
Chris
Top achievements
Rank 1
answered on 17 May 2010, 01:31 PM
It'd be great if that was simpler or more intuitive in the future, but thanks that worked great for me!

Tags
Editor
Asked by
Chris
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Chris
Top achievements
Rank 1
Share this question
or