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

RadEditor weird beahviour when custom menu

4 Answers 23 Views
Editor
This is a migrated thread and some comments may be shown as answers.
david
Top achievements
Rank 1
david asked on 18 Nov 2015, 11:43 AM

I am trying to have a custom dropdown on the editor but for some reason it is working but its also making my nonjustify tool active upppon using it here is my code

 

01.                   <telerik:RadEditor ID="txtMessage"  ToolsFile="~/BackDoor/ToolsFile.xml" runat="server" Skin="Bootstrap"  OnClientCommandExecuting="OnClientCommandExecuting" RenderMode="Auto">
02.                    <Tools>
03.    <telerik:EditorToolGroup>   
04.        <telerik:EditorSplitButton Name="TagList"  Text="Sets Dynamic Tags In Emails"   ImageUrl="~/assets/img/tags.png"  ImageUrlLarge="~/assets/img/tags.png" ItemsPerRow="5" PopupWidth="170px" PopupHeight="117px" RenderMode="Auto">
05.          <telerik:EditorDropDownItem  Name ="{Player_ID}" value="{player_Id}"/>
06.        <telerik:EditorDropDownItem  Name ="{Player_name}" value="{player_name}"/>   
07.        <telerik:EditorDropDownItem  Name ="{Player_IpAddress}" value="{player_IpAddress}"/>   
08.             <telerik:EditorDropDownItem  Name ="{Player_Points}" value="{player_points}"/>   
09.            <telerik:EditorDropDownItem  Name ="{Player_Points}" value="{player_prize}"/>   
10.        </telerik:EditorSplitButton>
11.    </telerik:EditorToolGroup>
12.</Tools> 
13.                     
14. 
15.                    </telerik:RadEditor>

And here is what i use in the client side event

 

01.   <script type="text/javascript">
02.        function OnClientCommandExecuting(editor, args) {
03.            var name = args.get_name(); //The command name
04.            var val = args.get_value(); //The tool that initiated the command
05.            if (name == "TagList") {
06.                editor.pasteHtml("" + val + "");
07.                //Cancel the further execution of the command as such a command does not exist in the editor command list
08.                args.set_cancel(true);
09.            }
10.        }
11.</script>
12.      
13. 
14.     
15.<style type="text/css">
16.    span .reTagList
17.    {
18.        background-image:url(/assets/img/label49.png);
19.       background-repeat: no-repeat;                                                         
20.    }   
21.         
22.</style>

 

Also I cannot get my icon to appear any ideas guys as what going on im using 30 day demo just

4 Answers, 1 is accepted

Sort by
0
david
Top achievements
Rank 1
answered on 18 Nov 2015, 11:45 AM
Also how do i add that dropdown into my tools xml as I want it avaible everywhere ?
0
Vessy
Telerik team
answered on 20 Nov 2015, 02:47 PM
Hi David,

The Non-justify tool get active after your custom-tool insertion, as it reflects the current justification of the focused element. As the inserted by you string is non-justified - the corresponding toll gets active.

As for the loading of such custom tools from external tools file - I am afraid that it is not possible for the moment.

Regards,
Vessy
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
david
Top achievements
Rank 1
answered on 22 Nov 2015, 04:18 PM

Is their anyway to disable that beahvior cause it would be wrong for the end user to think they have clicked the justify button??.

 

 

0
Vessy
Telerik team
answered on 24 Nov 2015, 01:55 PM
Hi David,

I am afraid that it is not possible to disable this functionality as it is executed on every element focusing in order to determine what are the actions applied to it. Following the same logic the Bold icon will be selected if the user clicks over a bold-applied text.

Regards,
Vessy
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Editor
Asked by
david
Top achievements
Rank 1
Answers by
david
Top achievements
Rank 1
Vessy
Telerik team
Share this question
or