Announcement

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

    Grid field getHidden vs. grid.fieldIsVisible

    We have noticed a behaviour discrepancy in latest smartgwt vs. our old app. Can't say for 100% sure if we've done anything or if it's changed behaviour between 12 and 13, but we're using the same code.

    Anyway, here's the deal:

    When we've created a grid, we hide the field with myField.setHidden(true);

    In both old and new version, the field does get hidden in the grid.

    However, later when we export, the grid behaves differently.

    in our old app, getHidden() returns true for the field, and grid.fieldIsVisible(field.getName()) returns false. This is what I'd expect.

    However, in 13,
    getHidden() now returns null while grid.fieldIsVisible(field.getName()) still returns false.

    So, according to the docs, I would expect it to still work as it does in 12? Or have you changed something? In any case, which one should I use to be sure that the value return accurately reflects the visibility of the field in the grid?

    Pointers appreciated.
    Last edited by mathias; 30 Jan 2023, 03:34.

    #2
    Hi mathias,

    You say "When we've created a grid, we hide the field with myField.setHidden(true)". I assume this means the grid is drawn and you now need to hide a currently visible column.
    If that's true, I'm pretty sure that ListGridField.setHidden() is to be called before creation only ("initally" in the docs, "IR" in SmartClient docs).
    The correct way to hide a currently visible field programmatically should be ListGrid.hideField(). See also this sample.

    Best regards
    Blama

    Comment


      #3
      Hey mate,

      to be honest I didn't give I much thought when I coded it - I tried it and it worked, and has worked.
      It's true that I call it before the grid is drawn, but as I mention above, previously the getHidden() method returns true from that moment on, post draw, in older versions, but returns null in 13, unless I've missed something.

      Comment


        #4
        Can you provide some standalone code, such as as modified Showcase sample, that reproduces this issue?

        Comment

        Working...
        X