how to copy from one cell to another after edit?

Hi,

I am having some trouble using the API its not clear to me. I am trying to copy the value of a cell after edit to another cell in the same row. This is what I am doing but how can I write to the cell at (rowID, cell_ID)

function doOnCellEdit(){
			
	var row = mygrid.getSelectedId();
	var cell = mygrid.getSelectedCellIndex();
	if(cell === 6){
		var value = mygrid.cells(row, cell).getValue(); <-- I need after data not before
		mygrid.setUserData(row,'username', value);  <-- this doesn't work, I need cell only
	 }
};

Thanks for you help…

function doOnCellEdit(){ var row = mygrid.getSelectedId(); var cell = mygrid.getSelectedCellIndex(); if(stage==2&&cell === 6){ var value = mygrid.cells(row, cell).getValue(); <-- I need after data not before mygrid.cells(rowID,cell_ID).setValue(value) } };

What is the value of stage and where is it defined?
I have a version of this code working the problem becomes the cell that is edited doesn’t take on the edited value but the second cell does. What I need is for both cells to be identical after the edit.
***NOTE ***

After some manipulation I figured it out. Here is the code for anyone who wants to do similar.
I am copying data from cell 6 on edit to cell 8.

function doOnCellEdit(){
			var cell = mygrid.getSelectedCellIndex();
			if(cell === 6){
				var row = mygrid.getSelectedId();
			  	var value = mygrid.cells(row, cell).getValue();
			 	mygrid.cells(row, 8).setValue(value);
			}
			return true;
		};

Thanks for your help.

Try to use the following code.
stage: stage of editing (0-before start[can be canceled if returns false],1- the editor is opened,2- the editor is closed);

mygrid.attachEvent("onEditCell", function(stage,rId,cInd,nValue,oValue){ if(stage==2&&cInd=== 6){ var value = mygrid.cells(rId,cInd).getValue(); <-- I need after data not before mygrid.cells(rId,8).setValue(value) return true } return true });