Archives for October 2006

DataGrid ItemRenderer with filtering

In response to a comment from Aaron on my last post about having issues with using ItemRenderers and filtering data I created a simple sample to show it working correctly and error free. I think the single biggest thing in getting renderers to work properly is to use strongly typed data and ArrayCollections as the dataprovider. This combination seems to prevent unwanted behaviour. Click here to see the sample. Do a right click to view the source.

Flex ItemRenderer CheckBox Sample

I have run across a lot of posts from people having problems getting checkboxes to properly work in itemrenderers in Flex 2. Here's an easy to follow sample that works. It displays a datagrid with four columns, the first two are just plain text columns, the third contains a checkbox that is bound to the underlying dataprovider and the fourth shows the text value of the boolean from the third column (just so you can see the value is really changing). Change some of the values, scroll up and down, everything stays the way it should, no mystery checks where they do not belong. Following is the actual code for the itemrenderer column, pretty easy. The click event just flips the bound value to the opposite of what it was.

<mx:DataGridColumn headerText="Online" dataField="online">
   <mx:itemRenderer>
      <mx:Component>
         <mx:CheckBox click="data.online=!data.online"  selected="{data.online}"/>
      </mx:Component>						
   </mx:itemRenderer>
</mx:DataGridColumn>

Hope this helps out, stay tuned for more datagrid help.

Find Flex Help Fast

Once again the internet has coughed up a wonderful little gem. I was searching for... actually I can not even remember now, when I stumbled across this great post on searching for Flex information. If you use Firefox you have likely noticed that little text area in the top right corner with either the Google 'G' or the Yahoo 'Y'. That's the search bar where search engine plugins reside, a quick place to query away. If you are developing with Flex, then you are likely doing a LOT of querying at Flexcoders or Adobe, hence the need for a quicker way.

After reading the post I decided to create a plugin to search the Flexcoders list on Yahoo (that way I can access messages right away as opposed to waiting for Google to index them). You can get my yahoo flexcoders plugin here.

Enjoy, Derrick.