0

I have mx DataGrids with custom item renderers on one column based on HBox. I tried to optimize them using the spark MXDataGridItemRenderer class, but using it results in the first row of the column being 2px shorter than the rest, as if the first row got hidden under the grid header. From the second row onwards the height is ok, but the first row problem results in every row being shifted up 2px. When selected, it looks just bad.

Any ideas would be much appreciated.

zero323
  • 322,348
  • 103
  • 959
  • 935
wlad
  • 60
  • 6

1 Answers1

0

I have seen this issue before as well. I am not sure what the RIGHT answer is but to solve it for my app I stopped using the spark crap. I see the benefits of spark but for me, its frustration level outweighs its usefulness. So the way I see it, you have 2 options:

1: Create MXDataGridItemRenderer for each grid column so that they are all uniform.

2: Don't try to optimize them and just stick with the HBox solution (thats what I did).

Dom
  • 2,569
  • 1
  • 18
  • 28
  • The first option only means, that *every* row will be shifted. Two pixels doesn't seem like much, but it is fairly visible in the datagrid. Seems like I'm stuck with no.2 (which is exactly what I was about to do before I gave it a shot here... :) ). Yup, spark frustration level is pretty darn high... – wlad Jun 15 '12 at 10:51
  • If you do option 1, you are correct, every row will be shifted, therefor you will not notice the shift at all. In theory anyways. – Dom Jun 15 '12 at 11:01
  • I fail to see where your frustration with Spark is coming from. It is way easier (in huge orders of magnitude) to do these kinds of pixel-perfect adjustments with Spark classes than with mx classes. That being said, the `MXDataGridItemRenderer` class was just a stopgap solution as long as there was no Spark DataGrid and as such it is bound to have its quirks. Why don't you just switch to Spark DataGrid entirely? @wlad – RIAstar Jun 15 '12 at 11:11
  • Yeah, I should've said "when mixing it with mx" - I do like Spark for its lightweight components and versatile skinning and stuff. But because it is lightweight when compared to mx, it misses a lot of pure css styling capabilities, which is exactly why it is not possible for us to do a complete switch at the moment as we rely heavily on style management in external tools that can only generate mx-compatible skins. – wlad Jun 15 '12 at 11:19