I have a number of combos in grids which I set to ‘read only’. If a user clicks on one of those and then presses the ‘backspace’ key the web page goes to the previous page visited. This only happens in IE8 but not in Firefox. Please HELP!! as this completely takes the user out of the application.
Since this post I have done more testing and I have removed all of the ‘readonly(true)’ methods from the combo boxes. Instead I return ‘false’ on all columns which should not be allowed for editing in the ‘onEditCell’ event. Even after doing that if somebody clicks in one of these cells and then presses ‘Backspace’ the browser moves to the previous site that was visited. It looks like any cell that cannot accept the focus shows this behaviour.
THIS IS A SERIOUS PROBLEM AND NEEDS TO BE SORTED PLEASE HELP.!!
<script type="text/javascript">
var winMenuOpts = new dhtmlXWindows();
winMenuOpts.setImagePath("/javascripts/dhtmlx/dhtmlxWindows/codebase/imgs/");
winMenuOpts.attachEvent("onKeyPressed",checkBackspace);
winMenuOpts.createWindow("test",20,20,500,200);
function checkBackspace(key)
{
alert("key = "+ key);
if(key == 8)
{
return false;
}
return true;
}
</script>
This creates a test window with the id = ‘test’ and if I press any keys I am NOT getting the alert. So it looks like the event is either not firing or dhtmlxWindow is not catching the ‘onKeyPressed’ event. The documentation for dhtmlxWindow does not mention ‘onKeyPressed’ as an Event that it handles but it is not giving an error either.
Please help as this situation needs to be resolved SOON.
Do you mean the ‘Backspace’ problem or the ‘OnKey’ event not firing? The only way I solved the backspace problem is by ensuring that my users started in a fresh ‘tab’ or ‘web page’. Then even if they press the backspace key there is no where for them to go.
I stopped trying to get the ‘OnKey’ event to work so I don’t know if it is still a problem or not.
Backspace issue is normal IE behavior, which I also hate by the way.
In other browsers you don’t go back to the previous page when you hit backspace.
In a “normal” combobox (select box) you also go back to the previous page when you hit backspace.
A user normally wouldn’t hit backspace in a select box as he knows you cannot edit the value of the select box.
But when you set the dhtmlx combobox to readonly(true), there’s still a cursor in the box.
This misleads the user as he will think you can delete or edit the value with backspace.
The readonly property of the combobox should be changed so you there’s no cursor anymore.
Just add this code snippet to dhtmlxcombo.js and the problem is solved.
I believe that this code snippet should be standard in the dhtmlxcombo.js as a normal user wouldn’t expect to go back to the previous page when he hits backspace.
In version 3.0 it’s not standard in the code.
Anyway, MS should change this IE backspace behavior. It frustrates everybody.
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan