Announcement

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

    Listgrid: hidden columns not visible in context header menu

    Hi,
    When I hide a column through the context header menu then the column disappears from the list if I re-open the header context menu, so I can't re-show the column anymore. See the attached screenshots.

    I have tested this with the latest 8.* nightly build. It worked in the 7 release afair.

    I also have columns with showIf: 'false' which according to the docs would hide the column but still make the column available in the list when opening the context header menu. However, these columns are neither listed in the context header menu. So maybe it is related.

    A last thing I noticed (is maybe a feature...), if I click on a column in the context header menu to hide it then the context header menu stays open, I would maybe expect it to be closed automatically.

    Can you let me know if I can solve the above with different settings or configurations.

    btw, I tested the above on chrome.

    Thanks!

    gr. Martin
    Attached Files

    #2
    Hi Gr. Martin
    We are not seeing the behavior you show in your screenshots. If you try it with one of the examples in the showcase (for instance the one at http://localhost:8080/isomorphic/system/reference/SmartClient_Explorer.html#adaptiveFilter in the SDKPackage), you'll see the menu correctly allows you to hide columns, and then if you dismiss the menu, and re show it, the menu item is present allowing you to re-show the column you hid.
    There must be something special about your use case - try putting together a standalone example demonstrating the problem and we'll take a look.

    In terms of the menu staying active - this is working as intended - it allows users to show / hide numerous columns at a time without having to re-show the menu. The menu will dismiss when the user clicks outside it.

    Comment


      #3
      Hi,
      It was indeed something specific in our code, we explicitly set the datasource in the grid using a call like this:
      this.viewGrid.setDataSource(this.dataSource, this.viewGrid.fields);

      this should however be:
      this.viewGrid.setDataSource(this.dataSource, this.viewGrid.completeFields);

      Although it is clear that we are doing something less standard here it can make sense to add to the docs that the fields property is initially used to list all fields but changed later to only contain the visible fields.

      Another thing I noticed is that all calls to ListGrid.setFields pass in a copy of the completeFields except for the call in ListGrid.refreshFields. I am not sure but should that call not be like this?
      refreshFields: function(){
      this.setFields(this.completeFields.duplicate());
      },

      But all imho, I don't know/understand all the internals ofcourse!

      Thanks for your help, topic is solved for us now.

      gr. Martin

      Comment


        #4
        When you set fields, you're setting the complete list of available fields. There's no need to set completeFields (which is an internal property and undocumented), instead, either don't specify fields or specify the list of fields you want visible; viewState then acts as an overlay on this set of fields.

        Comment

        Working...
        X