DataGrid Row Move

Another question on the Flex Forum about how to move a selected row on the DataGrid up or down, based on a button click.  The answer is straight forward, but with a catch. When you click on the DataGrid, it will give you an index for the row you have clicked.  The first row in the DataGrid is 0.  If you wanted to simply move a row up and down the DataGrid, then you simply add or subtract 1 from the selected index. Simple enough.  Unless you sort the DataGrid, which throws that out of wack and is pointless.  So, Continue reading DataGrid Row Move

Column Chart with Item Renderer – updated

Okay, it didn’t take me long to get back and do some more fiddling with the Column Chart Item Renderer. I went ahead and changed the static ArrayCollection to a dynamic one, because I was trying to figure out something with Themes and needed a button and the button should do something. The ArrayCollection is fairly simple for this chart, so all I did was create a couple of random values from 0 to 100 and made the “date” value the counter time 10. I set it up so that you can press a button and create new data, which Continue reading Column Chart with Item Renderer – updated

Date Sort in a DataGrid – the easy way

While trying to give suggestions to a post on the Flex Forum, I modified my Simple Data Grid to include a column for a Date. The poster had an issue with sorting the column with dates in it. My guess is, the Date value is actually a String object. It really isn’t very hard to create a Date from a string, just parse out the String and feed the appropriate date times into the Date object. Here is how I create the random date value. Since I insert the value into the item Object as a Date object, the sort Continue reading Date Sort in a DataGrid – the easy way

Simple DataGrid with Row Background Update

On the Adobe Flex forum, a question was asked about changing the background color for a row to a different color if the user selected it and hit the DELETE key. So, I updated the Simple Data Grid to include this feature. It doesn’t delete the row, but changes the background color to grey. The first step is to capture the keyboard action. To do this, a listener has to be created and set to listen for a KeyBoard event. I set it for the stage, but doing so requires that the function is called when applicationComplete instead of earlier. Continue reading Simple DataGrid with Row Background Update

ArrayCollection SortOn before a Sort

I have a display screen that shows a list of items waiting to be acknowledged by technicians. If the page isn’t acknowledged, then the page is escalated up to the next level. The display uses a DataGrid and when the number of items exceeds the displayable rows on the DataGrid, it uses pagination functions to create multiple pages for viewing the other items. When an ArrayCollection is sliced for each page, it causes an issue with sorting. When the data was sorted by level and datetime, it would only sort on the current slice of data, even if I sorted Continue reading ArrayCollection SortOn before a Sort

Simple DataGrid with ArrayCollection Update Example

I was helping out on the Flex community forum and one of the posts needed a little more of example than I could give using the forum post tools. So, I decided to create a quick example of a DataGrid using an ArrayCollection for the dataprovider. The ArrayCollection is created dynamically using a randomization selection from two static arrays. Then there is an option for updating the list showing which of the items have “Red” as the color value. I also put a couple of other items in the example, including an ItemRenderer for the DataGrid and a button holder Continue reading Simple DataGrid with ArrayCollection Update Example