Groups | Blog | Home
all groups > flash actionscript > february 2004 >

flash actionscript : DataGrid issue (pls URGENT)



esc63
2/16/2004 11:43:38 PM
Hello there,
how can I know what cell of a DataGrid the user has clicked?
any help is very appriciated

Thanks in Advance

Fallow Ground
2/17/2004 12:02:46 AM
Set an event handler on your datagrid like so

var myListener = new Object()
myListener.cellPress = function(event)
var cell = "(" + event.columnIndex + ", " + event.itemIndex + ")"
trace("The cell at " + cell + " has been clicked")
}
grid.addEventListener("cellPress", myListener)

As you can see you can access the columnIndex and ItemIndex for the cell that
was pressed. The docs for DataGrid can be found at


[L=LiveDocs-DataGrid]http://livedocs.macromedia.com/flash/mx2004/main/wwhelp/wwh
impl/js/html/wwhelp.htm?href=part4a_a.htm[/L

Fallo
esc63
2/17/2004 1:06:43 AM
Thanks a lot
I found this code somewhere

function cell_mouse_down(

result = "click handler called for " + this.colIndex + "," + this.rowIndex
+ "\n"
result = result + ("cell data: " + this.labelField.text)
} // End of the functio

I need to know the value of the cell, it looks like .labelField.text is
perfect but I don't how to use i

By

Es
AddThis Social Bookmark Button