Unfortunately currently there is no easy way to get a cell value for a datagrid.There is already an enhancement request logged for this http://bugs.adobe.com/jira/browse/FLEXENT-826 If this fix is important to you please vote on this.
As of now to access a cell value this is what you will need to do
- Use selectIndex to choose the particular row
- Use GetROProperty(“selecteditem”) to get the entire contents of that row
- Using the split function you can then split the row contents to the contents of each cell using | as the delimiter
Please find the sample code below
Browser(“Browser”).FlexApplication(“dg”).FlexPanel(“DataGrid Control Example”).FlexDataGrid(“dg1”).SelectIndex 0
RowContents =Browser(“Browser”).FlexApplication(“dg”).FlexPanel(“DataGrid Control Example”).FlexDataGrid(“dg1”).GetROProperty(“selecteditem”)
CellContents =Split(RowContents,”|”,-1)
msgbox CellContents(0)
msgbox CellContents(1)
msgbox CellContents(2)
Hope this helps!
How do u refer a row in an Advanced Data Grid when u use itemEditors (combo) ?
Currently, the automationname is a rowdata pipe separated and it is difficult to write a script to refer the column and set a value to a particular column (itemeditor)
Can i refer it with the data.label i.e FlexAdvancedDataGrid(data.label).FlexComboBox()
Could u post a blog related to this?
Hi
I didnt quite understand your requirment.Maybe you can mail me a sample mxml file and i will look into it.Please mail me at svakil@adobe.com
emailed you