put the mouse cursor in editable box

hi guys
In itemEditEndHandler() i am doing validation for each cell.

private function itemEditEndHandler(event:AdvancedDataGridEvent):void{
if(event.currentTarget.columns[event.columnIndex].editable){
if(id == null || id == ""){
Alert.show(ERROR);
}
put the mouse cursor in editable cell. Any idea how i can put the mouse cursor in the editable cell which has the error?
            }

thanks
royjaydAsked:
Who is Participating?
 
zzynxSoftware engineerCommented:
Try this:

yourGrid.editedItemPosition = { rowIndex:event.rowIndex, columnIndex:event.columnIndex };
0
 
zzynxSoftware engineerCommented:
btw, what about closing some of your open questions?
0
 
aubwebCommented:
Dear Royjayd,

For security reasons you can't control the mouse from actionscript. All the mouse coordinates are read only.

Other solution is to set the focus on the editable cell which as the error. By doing this the user will be able to type directly in the cell.

private function itemEditEndHandler(event:AdvancedDataGridEvent):void{
if(event.currentTarget.columns[event.columnIndex].editable){
if(id == null || id == ""){
Alert.show(ERROR);
} 
//put the mouse cursor in editable cell. Any idea how i can put the mouse cursor in the editable cell which //has the error?
drawFocusTo(event.currentTarget)
}

private function drawFocusTo(object:UIComponent):void
 {
     object.setFocus();
     object.drawFocus(true);
 }

Open in new window


Regards,

Aubweb
0
Firewall Management 201 with Professor Wool

In this whiteboard video, Professor Wool highlights the challenges, benefits and trade-offs of utilizing zero-touch automation for security policy change management. Watch and Learn!

 
royjaydAuthor Commented:
>>>drawFocusTo(event.currentTarget);  -- error on this line
currentTarget  is of type Object but you are passing it to UIComponent
drawFocusTo(object:UIComponent):

any idea?
0
 
zzynxSoftware engineerCommented:
Did you try my suggestion?
0
 
zzynxSoftware engineerCommented:
Thanx 4 axxepting
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.