• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 263
  • Last Modified:

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
0
royjayd
Asked:
royjayd
  • 4
2 Solutions
 
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
Cyber Threats to Small Businesses (Part 1)

This past May, Webroot surveyed more than 600 IT decision-makers at medium-sized companies to see how these small businesses perceived new threats facing their organizations.  Read what Webroot CISO, Gary Hayslip, has to say about the survey in part 1 of this 2-part blog series.

 
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

Featured Post

What Security Threats Are We Predicting for 2018?

Cryptocurrency, IoT botnets, MFA, and more! Hackers are already planning their next big attacks for 2018. Learn what you might face, and how to defend against it with our 2018 security predictions.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now