Hi There,
I have a RadEditor control on my page with the following lines of client side code:
editor.attachEventHandler("onkeydown", OnKeyDown);
function OnKeyDown(e)
{
if (e.ctrlKey === true && String.fromCharCode(evtobj.keyCode) === "S")
{
alert("Custom Save");
return stopPropagation(e);
}
}
function StopPropogation(e)
{
e.cancelBubble = true;
e.returnValue = false;
if (e.stopPropagation)
{
e.stopPropagation();
e.preventDefault();
}
return false;
}
This works in IE and Firefox, except that in Firefox the "Save As" dialog appears, no matter what i try. If i add a debugger line in my OnKeyDown method, the breakpoint gets hit AFTER the SaveAs dialog appears - so it seems that the attachEventHandler method of telerik adds the event too late or executes my code too late?
Applying my code to a test HTML page with:
document.onkeydown = OnKeyDown;
...works fine.
What is telerik RadEditor doing differently? What can I do to work around this?
Thanks.
I have a RadEditor control on my page with the following lines of client side code:
editor.attachEventHandler("onkeydown", OnKeyDown);
function OnKeyDown(e)
{
if (e.ctrlKey === true && String.fromCharCode(evtobj.keyCode) === "S")
{
alert("Custom Save");
return stopPropagation(e);
}
}
function StopPropogation(e)
{
e.cancelBubble = true;
e.returnValue = false;
if (e.stopPropagation)
{
e.stopPropagation();
e.preventDefault();
}
return false;
}
This works in IE and Firefox, except that in Firefox the "Save As" dialog appears, no matter what i try. If i add a debugger line in my OnKeyDown method, the breakpoint gets hit AFTER the SaveAs dialog appears - so it seems that the attachEventHandler method of telerik adds the event too late or executes my code too late?
Applying my code to a test HTML page with:
document.onkeydown = OnKeyDown;
...works fine.
What is telerik RadEditor doing differently? What can I do to work around this?
Thanks.
