I'm having problems trying to create a list view that contains a variable height rows, the height of which is determined by a TextArea inside an ItemRenderer (The ItemRenderer will contain other elements but for the sake of this example it contains only the TextArea)
I can't quite work out where I should be setting the height of the TextArea since it is dependent on the width of the list row, as well as the length of the text inside it (I had to also solve the issue that measureText does not take any line breaks into account by using a .split() on the text and counting the resultant number, and then calculating the number of physical lines each logical line needs)
At the moment I catch the TextArea's RESIZE event and recalculate the height there, and everything works fine....
...until I try and use the list view scroll bars. Then as new rows are added to the bottom (or top when scrolling up), the row height never gets calculated correctly because the RESIZE event is never raised. As I understand it, the new rows reuse item renderer instances that have just moved offscreen and it appears that this is the root cause of the problem.
I've tried moving the code around into measure() or updateDisplayList() but each time I get slightly different and not-quite-working behaviour. I've even tried manually dispatching a resize event to the TextArea in the item renderer's setter but this doesn't work either.
I've attached some screenshots - the TA backgound is set to pink for differentiation:
Fig1 - startup - everything looks as it should
Fig2 - start to scroll down - bottom entry has wrong height
Fig3 - scroll more, several entries now wrong height
If nudge the width slightly at this point it forces a resize & everthing re-renders correctly
Any suggestions greatly received!