0
votes

I'd like to know if it's possible to fill text fields by clicking on a data grid row, or by selecting a row and clicking a button "fill text fields".

Must be in AS3/Flash.

Thanks in advance.

1
So you just want a data grid where you click on a cell and then it fills a text field? I think this can be easily accomplished if you fill the data grid with buttons and just write some script so that when there's a click event on the button it fills the text field. Let me know if I'm interpretting it right...then I could give a more detailed answerspaderdabomb
Can you show what you tried so far to solve this problem?xxbbcc
@spaderdabomb. I'd like to get the complete row. I mean if there are 3 columns, I'll get 3 dynamic text fields filled.Sergio
@xxbbcc. Until now I did google for info about datagrid. I'm a newbie in that subject.Sergio
I did find this in stackoverflow: stackoverflow.com/questions/17474364/…. Looks interesting.Sergio

1 Answers

1
votes

I did try several aproaches and find a solution:

// import fl.events.ListEvent; <----- Important

toPrint.myGrid.addEventListener(ListEvent.ITEM_CLICK, onClick);
function onClick(e:ListEvent):void
{
    var over = e.item;

// Fill the dynamic text fields
    name.text = over.Name;
    surname.text = over.Surname;
    company.text = over.Company;
    year.text = over.Year;
}

WorkS like a charm.