Version 4 editCell on grid disables enter key and escape key

Hi

I just upgraded to version 4 and have three problems with grid.

  1. The selectCell function option to put cell into edit mode does not work. The cell is selected but does not enter edit mode. (note I am using dataProcessor so this might affect it somehow). Code is below.
function installTypes(tabs,tabid){
	var itLayout = tabs.cells(tabid).attachLayout('2U',"dhx_skyblue");
	itLayout.cells('a').setWidth(253);
	itLayout.cells('a').hideHeader();
	itLayout.cells('b').hideHeader();
	itToolbar = itLayout.cells('a').attachToolbar();
	itToolbar.setIconsPath("imgs/");
	itToolbar.addButton("add", 1, "", "Add-icon.png", "Add-icon.png");
	itToolbar.addButton("remove", 2, "", "Remove-icon.png", "Remove-icon.png");
	itToolbar.attachEvent("onClick", function(id){
		switch(id){
		case 'add':
			itGrid.addRow(99999,'new row');
			itGrid.selectCell(itGrid.getRowsNum()-1,0);
			window.setTimeout("itGrid.editCell();", 300);
			//itGrid.editCell();
			break;
		case 'remove':
			itGrid.deleteSelectedRows();
			break;
		}
	});
	
	
	itGrid = itLayout.cells('a').attachGrid();
	itGrid.setImagePath("lib/dhtmlx/imgs/");
	itGrid.setHeader("Name");
	itGrid.setColumnIds("name");
	itGrid.setColTypes("ed");
	itGrid.setInitWidths("247");
	itGrid.setSkin("dhx_skyblue");
	itGrid.init();
	url = urlPlusRandom("php/installTypes.php?x");

	
	itGrid.load(url);
	itDP = new dataProcessor(url);
	itDP.init(itGrid);
};
  1. If I use selectCell then editCell it still does not work. There is a timing problem and using setTimeout for the editCell is a workaround.

  2. Using editCell the Enter and Escape keys are disabled so the user can only save the cell by clicking on another cell or row.

Can someone please help with issue 3. I want the user to be able to press enter to save the cell value or escape to cancel. Note that this only occurs when editCell is called. If the user double clicks a cell to edit it - it works fine.

SOLVED: :smiley:

The window.setTimeout changes the focus and so the enter, tab and esc keys are focussed back to the window.

FIX: Code fragment below fixes the problem

It creates a function that includes both the cellselect and the celledit then calls the function from the window.setTimeout.

I hope this helps someone else

	function editTheCell(){
		ittGrid.selectCell(ittGrid.getRowsNum()-1,0);
		ittGrid.editCell();
	}
	ittToolbar.attachEvent("onClick", function(id){
		switch(id){
		case 'add':
			ittGrid.addRow(99999,'');
			window.setTimeout(editTheCell, 300);