Sort- and styleable dataGrid component for Adobe FLEX
Dienstag, 28. Oktober 2008 13:04
Since I started developing FLEX applications, I continously had problems with the dataGrid component.
First, I got into trouble trying to sort formated date strings, which can’t be handled by the dataGrid’s default sorting algorithm so easily, especially if it comes up to (German) date formats. While searching for a solution, I found the dataGridSortable component which extends dataGrid and provides a method to define your own search function.
In later development I had to face the necessarity of making the content of specific rows bold. The problem here was that the function setPropertyAt(rowNum:int, style:String) was deprecated. I still don’t get the idea why Adobe took out this method since it exactly did what I wanted.
However, I had to find a workaround somehow since dataGrid also does not offer anything that look like getRow(number:int) and return me a damn row object to style it via setStyle(…).
After not getting any further with google, I started to make a topic on adobe’s developer forum where some members, especially Amy Blankenship (Thanks again for the help!), helped me out and suggested using her dataGrid_withStyle component. The problem here was that I already had a component which extended dataGrid, so we came up with the idea of simply let Amy’s dataGrid_withStyle component extend the dataGridSortable and tadaa, it worked.
So, for all of you who seek for a sort- and styleable dataGrid component for FLEX, this little example might help you:
Download the example and the source files for the component here.
Thema: Informatikergedöhns | Kommentare (0) | Autor: Timo
