tags:

views:

20

answers:

1

Hi, Is it possible to call the function by using the datagrid column item? I want to call the function while the user click the particular column item in the datagrid? Thank's in advance...

A: 

You have to assign an eventhandler on the datagrid, and use a switch, which calls a function based on what you clicked on.

myDataGrid.addEventListener(DataGridEvent.ITEM_FOCUS_IN,clickFunction);


    private function clickFunction(e:DataGrigEvent):void
    {
        switch(e.label)
        {
             case 'function1': function1(); break;
             case 'function2': function2(); break;
             ...
        }

    }
Biroka
You can assign an ITEM_EDIT_BEGIN event too, but I don't remember if you have to let the datagrid to be editable or not, but you can try it how works the best.
Biroka
thank's ,i will try
maniohile