Posts Tagged ‘Components’

Checkbox DataGrid Component

Thursday, February 28th, 2008

Flex obviously let’s us do a lot of really awesome visual, immersive UIs. Unfortunately, sometimes we just have to make a component that Joe Schmoe user is familiar with so he can get his daily work done using the applications we create. One of the first things I found myself needing that Flex didn’t provide was a simple data grid with a column of selection checkboxes. Sure multi-select lists are good, but not all end users know to hold CTRL or Shift while making selections.

Disclaimer: This was one of the first custom components I ever made, and it’s not well documented. It needs to be rewritten, I just haven’t gotten around to it. I see requests for this on FlexCoders every once in a while, so decided to post what I’ve got in hopes that the community can expand on it.

(Update) - The things we learn!

This seems to be a popular topic today. Another post on FlexCoders was followed up by a blog post from Alex Harui with his implementation

Reading through it reminded me how much of an ineffecient hack my code was, so I updated it to be very similar. Only real addition is the ability to select/deselect all items with a header checkbox. Updated code and sample below.

CheckboxDataGridSample.mxml

CheckboxDataGrid.mxml

Try it out (may be slow to load…)