I have to Toggle the tools on the Editor based on the custom button click in the Editor itself. Basically We are trying to implement to display only few tools when we load the editor and there is a custom button added in it clicking on which full editor tools need to be displayed. Again there would be a minimize tools button clicking on which it has to hide all the tools except the basic tools which we were displaing when the editor is loaded. This toggling has to be done on the client side. So we dropped the plan of changing the tool file on the code behid using AJAX async postback.
I have tried implementing various options and implemented few stuffs. And I have few issues with it.
1. The Visible attribute for the Tools tag in XML is not working. - I have to hide the tools first time when I load the editor. still this tool set is visible in the tool bar. Sample:
<tools name="fullEditorToolSet2" visible="false"> |
<tool separator="true" /> |
<tool name="Undo" /> |
<tool name="Redo" /> |
<tool separator="true" /> |
</tools> |
<tool name="Undo" visible="false"/> |
2. I have gone throught this thread
http://www.telerik.com/community/forums/aspnet/editor/toolbars-tools-visible-fullscreen.aspx
and found code to create event handler to hide the seperator and also to hide the tool space and the final code given there
editor.AttachEventHandler( |
"onfocus", function() { .......}); |
is throwing a javascript error saying object dosenot suppot this property.(I am working on the lates editor release)
3.I tried implementing this way....I already have 2 custom button and the event created for it. So I am trying to do some thing like this
Telerik.Web.UI.Editor.CommandList["AdvancedTools"] = function(commandName, editor, args) { |
var tool = editor.getToolByName("Paste"); |
tool.set_visible(true); |
var tool = editor.getToolByName("ImageManager"); |
tool.set_visible(true); |
var tool = editor.getToolByName("FlashManager"); |
tool.set_visible(true); |
var tool = editor.getToolByName("MinTools"); |
tool.set_visible(true); |
var tool = editor.getToolByName("AdvancedTools"); |
tool.set_visible(false); |
} |
Telerik.Web.UI.Editor.CommandList["MinTools"] = function(commandName, editor, args) |
{ |
var tool = editor.getToolByName("Paste"); |
tool.set_visible(false); |
var tool = editor.getToolByName("ImageManager"); |
tool.set_visible(false); |
var tool = editor.getToolByName("FlashManager"); |
tool.set_visible(false); |
var tool = editor.getToolByName("MinTools"); |
tool.set_visible(false); |
var tool = editor.getToolByName("AdvancedTools"); |
tool.set_visible(true); |
} |
Show Advanced tools are working fine but when i minimize the tools there is a gap and seperators displayed(its just hiding the tool and so the space is left as such) and I am not able to hide the tool seperator also.
Also I need some way to hide the tools(by default) when I load the editor first time.
Or Is there a way to change the tool file(XML) for the editor on the client side based on the toggling? so that I can create 2 files and toggle between those.
Can any one please help me?
Thanks,
Akila.