[CLOSED] Tooltip and KeyMap is not working on htmlEditor
Hi Team,
we are using HTMLEditor in our application.we have couple of issues with this editor.
1.On this Editor we have implemented Ctrl+S Keymap( Shortcut key) functionality for saving the content of editor,but it is not working .It works fine when we set the focus to some other control on this page.If Editor has the focus then it doesn't fire the event.
2.Editor is not showing tooltips for botton icons like Bold, Italic, Underline etc.,
we are using fallowing code.
Code:
<ext:KeyMap ID="keySave" runat="server" Target="={Ext.isGecko ? document : Ext.getBody()}">
<ext:KeyBinding Ctrl="true" StopEvent="true">
<Keys>
<ext:Key Code="S" />
</Keys>
<Listeners>
<Event Handler="SaveTemplate();" />
</Listeners>
</ext:KeyBinding>
</ext:KeyMap>
<ext:ViewPort ID="ViewPort2" runat="server" AutoHeight="true">
<Body>
<ext:BorderLayout ID="BorderLayout2" runat="server">
<Center>
<ext:Panel ID="panel2" AutoScroll="false" BodyStyle="padding: 0 0 0 0 px;" runat="server">
<Body>
<ext:RowLayout ID="layout1" runat="server">
<ext:LayoutRow RowHeight="0.75">
<ext:Panel ID="panel3" runat="server">
<Body>
<ext:HtmlEditor ID="Editor1" runat="server" Width="930" Height="350">
</ext:HtmlEditor>
</Body>
</ext:Panel>
</ext:LayoutRow>
</ext:RowLayout>
</Body>
</ext:Panel>
</Center>
</ext:BorderLayout>
</Body>
</ext:ViewPort>
RE: [CLOSED] Tooltip and KeyMap is not working on htmlEditor
Hi,
Try the following sample
Code:
<%@ Page Language="C#" %>
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
ScriptManager1.AddBeforeClientInitScript("Ext.QuickTips.init();");
}
</script>
<script type="text/javascript">
function checkKey(e){
if(e.ctrlKey && e.getKey() === e.S){
alert("Saving...");
}
}
</script>
</head>
<body>
<ext:ScriptManager ID="ScriptManager1" runat="server">
</ext:ScriptManager>
<ext:KeyMap ID="keySave" runat="server" Target="={Ext.isGecko ? document : Ext.getBody()}">
<ext:KeyBinding Ctrl="true" StopEvent="true">
<Keys>
<ext:Key Code="S" />
</Keys>
<Listeners>
<Event Handler="alert('Saving...');" />
</Listeners>
</ext:KeyBinding>
</ext:KeyMap>
<ext:ViewPort ID="ViewPort2" runat="server">
<Body>
<ext:BorderLayout ID="BorderLayout2" runat="server">
<Center>
<ext:Panel ID="panel2" AutoScroll="false" BodyStyle="padding: 0 0 0 0 px;" runat="server">
<Body>
<ext:RowLayout ID="layout1" runat="server">
<ext:LayoutRow RowHeight="0.75">
<ext:Panel ID="panel3" runat="server">
<Body>
<ext:HtmlEditor ID="Editor1" runat="server" Width="930" Height="350">
<Listeners>
<Initialize Handler="Ext.EventManager.on(this.getDoc(), {keyup: checkKey});" />
</Listeners>
</ext:HtmlEditor>
</Body>
</ext:Panel>
</ext:LayoutRow>
</ext:RowLayout>
</Body>
</ext:Panel>
</Center>
</ext:BorderLayout>
</Body>
</ext:ViewPort>
</body>
</html>
RE: [CLOSED] Tooltip and KeyMap is not working on htmlEditor
Thanks a lot :)it works for us.
Thanks & regards
YobNet Team