3 Replies Latest reply on Nov 15, 2011 12:35 PM by robglobal

    Strange ItemRenderer visibility issue

    vcbcpna3465

      Hello all,

       

      My issue is a strange one.  Basically I have a Pod with 2 grids.  When  pod is in it's restored/default state, Grid 1 is displayed.  However, when it is in its maximized state, Grid 2 is displayed.  Grid 1 has a subset of Grid 2 data with both Grids listening to real time updates.  Think of it as a stock price ticker, with Grid 1 being the "simple" view and Grid 2 is the more complex view with more data.  For our example, let's say both grids share the same column called "price".  If price is less then or greater then current price, change color to red or blue.

       

      Scenario: In a restored state, where Grid 1 is visible and Grid 2 is NOT visible, change price comes in, price field in Grid 1 is changed to blue.  Grid 2 handles the same event correctly and tries to change it to blue as well (i know this only because I have trace statements, event though Grid 2 is not yet visible).  I see that Grid 1 shows the change correctly.  When I maximize to show Grid 2, the price column changes color at random!  Sometimes it's blue, sometimes it's red, and sometimes it's the default (black).  Everytime i click restore and maximize in succession, i get random results for Grid 2.

       

      I'm wondering if datagrid visibility does some strange things to itemrenderers. I know itemrenderers are re-used.  To do a test, i made Grid 1 and Grid 2 to have different renderer classes.  But the issue still exists.

       

      Thanks in advance.

        • 1. Re: Strange ItemRenderer visibility issue
          robglobal Level 1

          So you have a simple condensed view and an expanded view? Are you making use of viewstates and using a single grid instead of working with 2 separate grids?

          • 2. Re: Strange ItemRenderer visibility issue
            vcbcpna3465 Level 1

            Correct.  Grid1 is visible only in the condensed view.  Grid2 is visible only in the expanded view.  In this example, say both Grids share the same column "price".  When a price increases, the font needs to turn blue.  Assuming condensed state, Grid1 font changes to blue, but when we goto explanded Grid2 price font should also be blue.  Im' guessing Grid2 is behaving strangely because the renderers are acting funny when Grid2 isn't visible on the screen.  Technically, we're trying to update Grid2 behind the scenes so that when we set visible=true, the proper font colors are shown.

             

            I'm using 2 separate grids.

            • 3. Re: Strange ItemRenderer visibility issue
              robglobal Level 1

              I see what you're saying. If Grid2 is a redundancy of Grid1 with some extras, I'm wondering why you don't just use one grid and with states for example

               

              <s:state name="condensed" />

              <s:state name="expanded" />

               

              <s:datagridcolumn visible.expanded=false />

               

              It may help with the errors you are experiencing, but Im not positive. We switched our data grids over to data groups a couple months ago and found it was faster and much easier to fully customize; however, we didnt' need built-in grid features like sort...

               

              anyway, hope this helps.