Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Atul on Nov 12, 2007 05:51
open dhtmlx forum
dhtmlXGrid

How to off/change default functionality of "Enter key" which makes cell to non-edit mode?
Answer posted on Nov 12, 2007 11:30
You can disable enter key as

grid.attachEvent("onKeyPress",function(key){
    if (key==13) return false;
    return true;
});
Answer posted by Atul on Nov 13, 2007 02:13
Hi again ,
I used following code to disable enter key,
grid.attachEvent("onKeyPress",function(key){
    if (key==13) return false;
    return true;
});
but when cell is in edit mode and we pressed enter now whole page is getting submitted.would you please tell why this is happening and any quick solution to it?
Thanks for quick support,its really appreciated.
Atul
Answer posted on Nov 13, 2007 03:36
The code which I mentioned just disable the handling of enter key, so it goes through to page , and if you have grid inside form, it can trigger default button of form ( submit button )

If you want to disable just edit stop behavior you can locate next code in dhtmlxgrid.js ( line 1325 )

            k13_0_0:function(){
   //                this.editStop();      //this line need to be commented.
Answer posted by Atul on Nov 13, 2007 05:11
Issue resolved by commenting the code this.editStop();
Thanks for support.
Atul