Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    CSS background-image does not load immediately

    I've been unable to get this down to a test case, but wanted to ask if anyone has had a similar issue and if they know any solutions. I do have a workaround.

    I wanted to use the override Listgrid.getCellCSSText/Style() methods to show a background image in a field based on the value of another field in the same record. So, something like Record = (FieldA, FieldB) - where FieldB is hidden and FieldA shows a background image if FieldB is true.

    It works, but it does not show the image until I mouse over the grid, forcing an extra call to getCellCSS. Now the obvious question is, well, does it actually call getCellCSSxxx on the first draw. I put log messages in to show that it does. More strange is that if my CSS does not use background-image, say just changing the color, then the style is shown the first time around.

    My workaround to this is to use Hilites and append the image as HTML in the field (as done in the Hilites examples in the showcase). (btw using CSS in hilites also has the same problem).

    I wonder if there is a reason for this, if it is a limitation of how the grid is rendered, a bug, or if I am doing something wrong. Has anyone successfully used CSS that sets a background-image with a listgrid?

    The same behaviour is seen in FF3.5 and Chrome 16.
Working...
X