Hi,
I am using RadEditor for ASP.Net AJAX. i have created custom EditorSplitButton with dropdownitems.
if i click one dropdownitem, it will fire the event correctly. after that the selected item wont be reset.how can i do that in javascript.
// Design
<telerik:RadEditor runat="server" ID="RadEditor1" Skin="Sunset" EditModes="Design" OnClientCommandExecuting="OnClientCommandExecuting">
<Tools>
<telerik:EditorToolGroup>
<telerik:EditorSplitButton Name="FontSize" Text="Size" ItemsPerRow="1" ShowText="true" Width="200px">
<telerik:EditorDropDownItem Name="Smallest" Value="1"/>
<telerik:EditorDropDownItem Name="Smaller" Value="2"/>
</telerik:EditorSplitButton>
</telerik:EditorToolGroup>
</Tools>
</telerik:RadEditor>
//Javascript
function OnClientCommandExecuting(editor, args)
{
if (name == "FontSize")
{
var tool = args.get_tool();
var span = tool.get_element().getElementsByTagName("SPAN")[0];
span.style.backgroundImage = "url(" + val + ")";
editor.pasteHtml('[SIZE="' + val + '"]' + editor.getSelectionHtml() + '[/SIZE]');
args.set_cancel(true);
editor.getSelectedElement() = val;
}
My question is initially the tool looks like , FontSize- within the dropdown Smallest,Smaller will come.
if i select Smaller, it fires the event and selected item is on the top.
but i want to reset the tool, so that Font Size will come on the top.
How to do that?
Please reply me early,
Thanks,
Mano.
I am using RadEditor for ASP.Net AJAX. i have created custom EditorSplitButton with dropdownitems.
if i click one dropdownitem, it will fire the event correctly. after that the selected item wont be reset.how can i do that in javascript.
// Design
<telerik:RadEditor runat="server" ID="RadEditor1" Skin="Sunset" EditModes="Design" OnClientCommandExecuting="OnClientCommandExecuting">
<Tools>
<telerik:EditorToolGroup>
<telerik:EditorSplitButton Name="FontSize" Text="Size" ItemsPerRow="1" ShowText="true" Width="200px">
<telerik:EditorDropDownItem Name="Smallest" Value="1"/>
<telerik:EditorDropDownItem Name="Smaller" Value="2"/>
</telerik:EditorSplitButton>
</telerik:EditorToolGroup>
</Tools>
</telerik:RadEditor>
//Javascript
function OnClientCommandExecuting(editor, args)
{
if (name == "FontSize")
{
var tool = args.get_tool();
var span = tool.get_element().getElementsByTagName("SPAN")[0];
span.style.backgroundImage = "url(" + val + ")";
editor.pasteHtml('[SIZE="' + val + '"]' + editor.getSelectionHtml() + '[/SIZE]');
args.set_cancel(true);
editor.getSelectedElement() = val;
}
My question is initially the tool looks like , FontSize- within the dropdown Smallest,Smaller will come.
if i select Smaller, it fires the event and selected item is on the top.
but i want to reset the tool, so that Font Size will come on the top.
How to do that?
Please reply me early,
Thanks,
Mano.