Question

I'm new to Flex, but I've been exploring it with Flex Builder, and its pretty good.

Indeed the best for fast building of Web based Apps...

I'm trying to do something with eventListeners, but i still do a lot of messy code, so wanted help of those who already know flex.


I'm have a DataGrid, and its items are added by another component, no problems with that.

I have buttons to Add, Remove and Edit the items inside the DataGrid. No problem with that too.

But i want those button to be enabled when the DataGrid as at least one item, and when it doesn't as any, all three buttons should be disabled.

How should i do it?

EDIT: Forgot to say: I think eventListeners are the best way. But.. you tell me.

Was it helpful?

Solution

This should do it:

<mx:DataGrid id="mydg "dataProvider="{books}"   horizontalGridLines="false">
</mx:DataGrid>

<mx:Button enabled={mydg.dataProvider.length!=0} label="my button"/>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top