Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted on Mar 17, 2008 14:45
open dhtmlx forum
cell value during edit mode

I was just wondering, is there any way to retrieve the string currently entered by the user while still in edit mode? I would like to do some error catching by taking the whole entry every time the user enters a character to match it against a string pattern for example.
Answer posted by Support on Mar 18, 2008 03:05
You can use "onEditCell" event handler. 

mygrid.attachEvent("onEditCell", function(stage,rowId,cInd){

        if(cInd==INDEX && stage==1){

            mygrid.editor.obj.onkeypress = function(e){

                 if(this.value==SOME_TEMPLATE){

                    return false;

                }
            }
        }
        return true;
   })
Where cInd - index of edited cell, stage 1 - when editor is opened.