0

Could anyone please explain what is the best practice of using itemrendrers for Adv. DataGrid in Flex? Should one use tag and write the component or by using itemrenderer property?

Regards, Wrinkle

wrinkle
  • 11
  • 3
  • I voted to close as "Best practice" is very subjective and what is best practice in one situation may not be best practice in another. I might make different situations if "time to market" is an issue than I would if long term maintainability is given high priority, for example. Since such business reasons may dictate the preferred approach; this isn't really a question that can be answered universally. – JeffryHouser Aug 28 '11 at 14:47

3 Answers3

2

IMHO you should factor out the itemrenderer. Look at it as an investment in the long-term maintainability and modularity of your code. It could be that if you wrote the renderer generic enough, you could reuse it elsewhere in that project, or in future projects.

(I am assuming a non-trivial item-renderer - e.g. one that inherits from Label and changes the color)

Dan
  • 1,163
  • 14
  • 34
0

No difference in performance.

Small difference in readability: if your renderer is rather small, there's no point extracting it as separate class. And vice-versa, if renderer grows huge, leaving its internals inside DataGrid tag may look awfull.

moropus
  • 3,672
  • 1
  • 22
  • 30
0

There is one big difference, if you are debugging a component. In my case I am using IntelliJ and there seems to be an Issue (They claim it to be a Flash issue) that renders all Breakpoints invalid as soon as one inline component is found.

Christofer Dutz
  • 2,305
  • 1
  • 23
  • 34