What I want to do is simply close the popup with the Esc key.
I have a RadGrid set up with popup edit form template. The popup itself contains two RadButtons, a RadEditor, two RadDateTime Pickers, and a RadTextBox.
In the ClientSettings I have the declartion OnKeyPress="OnKeyPress".
The Javascript function is as follows:
function OnKeyPress(sender, args) {
var masterTable = $find("<%=RadGrid1.ClientID%>").get_masterTableView();
if (args.get_keyCode() == 27) {
masterTable.fireCommand("CancelAll", "");
}
}
This works, sort of.
It does not work on the initial appearance of the popup or if the RadEditor has the focus. If I set the focus to one of the other controls or just click on the body of the popup, it works fine.
Suggestions?
I have a RadGrid set up with popup edit form template. The popup itself contains two RadButtons, a RadEditor, two RadDateTime Pickers, and a RadTextBox.
In the ClientSettings I have the declartion OnKeyPress="OnKeyPress".
The Javascript function is as follows:
function OnKeyPress(sender, args) {
var masterTable = $find("<%=RadGrid1.ClientID%>").get_masterTableView();
if (args.get_keyCode() == 27) {
masterTable.fireCommand("CancelAll", "");
}
}
This works, sort of.
It does not work on the initial appearance of the popup or if the RadEditor has the focus. If I set the focus to one of the other controls or just click on the body of the popup, it works fine.
Suggestions?