Announcement

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

    How to get handle to parent grid from within HoverCustomizer

    I'm using ListGrid.setHoverCustomizer() and in my hoverHTML method I need to get a handle to the grid on which the hover customizer is operating. hoverHTML() is passed the record being hovered over, the row and column numbers, but not the grid itself. I need to get the ListGridField and can do so, given that the colNum is passed to hoverHTML. But how do I get a pointer to the grid itself?

    #2
    Currently you can handle this at the application level by hanging onto a reference to the ListGrid in question somewhere - EG using closures, final vars, member vars, etc.

    However we recognize that this is trickier than it should be so have made a change in the 3.1d branch to support a "getGrid()" API directly on the HoverCustomizer object.
    This will be present in nightly builds going forward

    Comment


      #3
      Thanks. That does make it easy.

      But I have the same issue in a DataArrivedHandler. I need to do some things to the grid when data arrives. If there were only one instance of this grid in the class it would be easy, but this grid is the expansion component of another grid, so there are potentially multiple instances of it.

      Comment


        #4
        It seems like simply creating the EventHandlers for that grid in the scope where the grid is created solves this problem.

        Comment


          #5
          I see what you mean. Declare the grid variable as final and then refer to that in the data arrived event.

          Thanks!

          Comment

          Working...
          X