:: Forum >>
Alex- i need to set cusor in grid cell+vlidation in grid cell clashing
Alex
Pls answer this i am struggle to get out of this
I need to set cursor on grid cell on click of new row which i did like below
this.obj.setCurrentColumn(0);
this.obj.setSelectedColumns([0]);
this.obj.raiseEvent("editCurrentCell",{});
This worked fine but i also set the maxlength to the same cell on keypress this doesn't work simply because i am handling this in oncellEditstarted using event.srcElement.onkeydown here srcElement is undefined but if i doubleclick on cell then it enters onCellDoubleClicked function this time everything works fine
this.onCellEditStarted$ = function(text,col,row)
{
event.srcElement.onkeydown = function(){
if (event.keyCode > 46 && event.srcElement.innerText.length >= colList[col].maxlength) return false;
}
}
this.obj.raiseEvent("editCurrentCell",{});
after above line how to explicitly call onCellDoubleClicked so that it gets srcElement
Any suggestion
Thanks in Advance
Sufiya Khan
Monday, August 13, 2007
Alex,
I have sorted the above problem but left with one problem
I have added onCellTextChanged function like as follows
this.onCellTextChanged = function(text,col,row){
event.srcElement.onkeydown = function()
{
alert("event.keyCode"+event.keyCode);
if (event.keyCode > 46 && event.srcElement.innerText.length >= colList[col].maxlength) return false;
if(colList[col].numericOnly)
{
//alert("numeric"+text.length);
return numeralsOnlyForGrid(event);
}else if (colList[col].numericWithDecimalsOnly)
{
var cellVal = event.srcElement.innerText;
return numeralsWithDecimalForGrid(event,cellVal);
}
}
}
But the problem here is first time it doesnot enter event.srcElement.onkeydown function and keycode returns null second time onwards it works fine(no vlidation happening for first charecter)
Pls help me !!!
thanks in advance
Sufiya Khan
Monday, August 13, 2007
Alex,
I just chaged onkeydown to onkeyup it worked fine
thanks
Sufiya khan
Sufiya Khan
Monday, August 13, 2007
This topic is archived.
Back to support forum
Forum search