Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Jimmy on Apr 17, 2008 09:59
open dhtmlx forum
keycode 13

Hello,
I using dhtmxl grid proffesionnal. The grid intercept the "enter" event and cause a bug in a web page which have a form. the grid submit my form...

how disable the "enter" event capture of the grid.

Thanks
Answer posted by Support on Apr 17, 2008 10:11
The next peace of code must help

mygrid.attachEvent("onKeyPress",function(code){
    if (code==13) return false;
    return true;
})
Answer posted by Jimmy on Apr 18, 2008 02:48
the event capture is at line 3519 of dhtmlxgrid.js in source of  pro_v15_80319

i have comment :

    if (!document.body._dhtmlxgrid_onkeydown){
      dhtmlxEvent(document,"keydown",new Function("e","if (globalActiveDHTMLGridObject) return globalActiveDHTMLGridObject.doKey(e||window.event);  return true;"));
      document.body._dhtmlxgrid_onkeydown=true;
    }
Answer posted by Support on Apr 18, 2008 07:50
Yep, this is global handler used by grid, but this code doesn't block event, so it must not affect logic of page.
If "return true;" somehow causes issue in your case - you can freely remove it ( we will remove it in next build of grid in any case, because it has not any special sense.