Announcement

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

    Listgrid cellformatter and hover

    Hi, i think i noticed an interesting thing that i've never noticed before.

    I have a cell with both a hovercustomized and a cellformatter. They both work fine.

    However, after adding some trace output to look at an unrelated thing, i noticed that the "format" method of the cellformatter is called when i hover over the cell.

    This is unneccessary i my case, and i'm not sure why? So that i can change the content of the cell when hovering?

    Is there a way to turn it off?

    #2
    This is desirable almost all the time, since otherwise, there would be a mismatch between the cell value and the hover value. If you actually want the hover to differ, you can just implement a hover handler, as usual.

    Comment


      #3
      Yeah, when we do have hover handlers, it's almost always because we want the hover to say something else then what's in the cell. Let me give you an example.

      In our event-dbtable we have a column that says "channel". This means how the event came in. It might be SMS, NFC, Manual, location based etc etc.

      This might be a column in a client-side grid. However, we don't want it to say "1", "2" etc like it does in the db. We want to use an icon, which is why we use a cellformatter. SMS gets an 'SMS'-icon and so on.

      We then also have a hovercustomizer so that if a user hovers over the icon, we will have the hover say "SMS", "NFC" etc. in a localized fashion. In some cases we also put additional information in, both dynamic and static.

      So, to use those two methods are unrelated and it is always waste for either to call the other.

      Comment


        #4
        Hovers are often used to show clipped content. While you can add hover handlers that show whatever else you want, the default of showing the same thing as the cell is definitely desirable.

        Comment


          #5
          Yeah, i suppose. For our usecase, it works and looks great! Would have been neat to be able to turn constant re-evalutation off.

          Comment

          Working...
          X