strange behaviour oncelledit


i have noticed a very strange behaviour on cell edit. i have a function setup as follows:


    function onEditCell(stage,rowId,cellId, newValue, oldValue)


if(stage ==2 && cellId == 0)


if(isLegalString(newValue) == false)


return false;



return true;


inside the event i take the newValue and test if it is a legal string (checking all of its characters) if it is not a legal sting, i return false and return true if it is a legal string.

i have noticed that if i enter an illegal string on a ‘tree’ type column, it returns false and the value of that cell is displayed as it was before the edit - which is expected behaviour - but if i attempt to output the following (for the row the on edit just refused):

alert(mygrid.cells(mygrid.getSelectedId(), 0).getLabel());

it displays the html code of a textarea e.g. <textarea etc…

have you noticed this? is this a bug your end or mine, i cant see any problems my end but if this doesn’t occur your end then i will need to look harder!!!

thanks very much


If getLabel command called inside onEditCell stage 2 event, or after it - the data must be returned correctly ( and so it is in local samples )
But if you calling this command when cell in edit state ( after edit start and before onEditCell stage 2 ) - the method will return actual cell value, which is code of editor in that moment. To be sure that cell is not in edit state you can call
before accessing cell data

If problem still occurs for you, and it occurs for cell after edit - please provide any kind of sample where problem can be reconstructed ( you can send it directly to )


thanks for the reply. yes it was partly this and partly due to i was saving the data even if it was being returned false. thanks very much


my apologies, this has not yet been fixed.

why on a tree column does stage 2 not occur when it would usually do on any other column type. it appears that when you are editing a tree column that stage 2 occurs when you are actually typing, whereas on other column types stage 2 occurs only when you have completed editing and wanting to come out of the cell?


nope, i have just noticed on many different column types, including ed, that stage 2 is occuring when you are typing. has your developers changed something as stage 2 only used to occur when editing was complete and you wanted to come out of the cell?


Problem can’t be reconstructed locally. The way how onEditCell event generated was not affected by any of latest changes, actually by existing logic this event may occur only when currently active editor  closed.

If problem still occurs for you - please provide any kind of sample where problem can be reconstructed.
( The only possible reason of something similar - usage of editStop|editStart from inside of onEditCell event, in such case different complex situation possible )

hi, thanks for the reply, sorry about that it must be something to do with my code then. thanks