I have tried fireEvent, but still have problem.
Actually I want to let user press "Enter" to jump to next control as press "TAB"
But the problem is when when user press enter in the TextArea, it also jump to next control.
I want to modify that press Ctrl + Enter for TextArea to jump to nect line
So I add this JS on my form
Ext.get(document.body).on('keydown', commonkeydown);
function commonkeydown() {
if (event.ctrlKey != 1) {
if (event.keyCode == 13)
event.keyCode = 9;
} else {
if (event.keyCode == 13) {
// var wsh = new ActiveXObject("WScript.Shell");
// wsh.SendKeys("{ENTER}");
var customEvent = document.createEventObject()
customEvent.bubbles = true;
customEvent.cancelable = true;
customEvent.view = window;
customEvent.ctrlKey = false;
customEvent.altKey = false;
customEvent.shiftKey = false;
customEvent.metaKey = false;
customEvent.keyCode = 13;
document.body.fireEvent("onkeydown", customEvent);
}
}
}
I try use fireEvent to simulate a "Enter" press. It works if I insert a breakpoint in the JS, and run it line by line.
When I remove the breakpoint, try directly in my form it didn't work.
Any idea? Thank you~