3.2.0

Focus lost when setting AW.UI.Input as cell template

If I set a AW.UI.Input as Cell template in a Grid with :

obj.setCellTemplate(new AW.UI.Input, 1, 1);

The input shows OK, but each character typed in causes a focus lost and the user has to click the input field with mouse again. Also, tab index dose not work in this case.


OlivierP
December 6,
me too
March 12,
obj.setCellEditable(false);
var lastcol="";
var lastrow="";
var MyInput = new AW.UI.Input;
var defaultcelltemplate = obj.getCellTemplate(0,0);

obj.onCellClicked = function(event, col, row){

obj.setCellTemplate(defaultcelltemplate, lastcol, lastrow);
obj.getCellTemplate(lastcol, lastrow).refresh();
obj.setCellTemplate(MyInput , col, row);
obj.getCellTemplate(col, row).refresh();

var celltext = MyInput.element().getElementsByTagName("input")[0];
celltext.focus();
if (celltext.createTextRange) {
var r = celltext.createTextRange();
r.moveStart('character', celltext.value.length);
r.collapse();
r.select();
}
lastcol = col;
lastrow = row;
}

// write grid html to the page
document.write(obj);
March 12,
up is my code.
I want to edit cell on click,not on dbclick.
but,I get this error.
Who can help me?!
chata
March 12,

This topic is archived.

See also:


Back to support forum