Checkbox DataGrid Component
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.
Try it out (may be slow to load…)
Tags: Components, DataGrid, Flex
July 31st, 2008 at 1:56 am
How can unselect all checkbox by click a button…?
July 31st, 2008 at 8:52 pm
Well, using this component you can click the header checkbox in the checkbox column to select/unselect all items. Programmatically you could do
myCheckboxDG.selectedItems = [];
August 1st, 2008 at 2:16 am