Friday, November 07, 2008

The Same LabelFunction for DataGrid and ComboBox

In Flex, some label functions accept two arguments, i.e. item and column in a datagrid, and some accept one, i.e. item in a combobox. If you're not using the data from the column, which is typically just the dataField anyway, then you don't need two labelFunctions. The easiest way to fix the problem is by making the column field optional. private function fullName(item:Object,dgc:DataGridColumn=null):String{ return item.FIRST_NAME+" "+item.LAST_NAME; } Just add "=null" and you're done!

0 Comments:

Post a Comment

<< Home

Feed (RSS/Atom)

Contact Me

Don't put anything here: