Triggering Function Event on Selecting a row in an Advanced Data Grid

3k views Asked by At

The Following code seems to only be working when i have editable="true" on the Advanced Data Grid. But I don't want it it be editable. Anyone have any idea or experience with this issue?

The docs don't say anything about it needing to be editable, and i dont see why it should need to be.

http://docs.huihoo.com/flex/4/mx/events/DataGridEvent.html#ITEM_FOCUS_IN

a_data_list.addEventListener(AdvancedDataGridEvent.ITEM_FOCUS_IN, clickedRow);


    public function clickedRow(event:AdvancedDataGridEvent):void
                {
                    trace("datagrid line was clicked");

                }
2

There are 2 answers

0
brybam On BEST ANSWER

Actually, sorry christophe, the proper solution to the issue is using

ListEvent.ITEM_CLICK

Because for example if the highlighted item is already highlighted it will not trigger the function because it does not "change" what does work perfectly for this issue though is item click. But thanks for pointing me in the right direction

1
Christophe Herreman On

You need to listen to the "change" (ListEvent.CHANGE) event if you want to know when rows are selected/deselected.