Announcement

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

    Cannot change configuration property 'headerSpans' for List Grid

    Hi,

    On a click I'm trying to load a new datasource into a ListGrid.
    Code:
    grid.setDataSource(dataSource);
    grid.setHeaderSpans(...);
    I got this exception:

    Error :Cannot change configuration property 'headerSpans' to [Lcom.smartgwt.client.widgets.grid.HeaderSpan;@189a36 after the component has been created.

    Not sure what's wrong. Using SmartGWT 2.1

    Thanks,
    Maksym

    #2
    Headerspans are a one time thing, you can't change them dynamically once the grid is created. If you want to set new header spans, you need a new grid.

    Comment


      #3
      I have a similar situation, with ListGrid whose column structure will be dynamic.

      Given that my ListGrid has already been added to a layout and rendered once, when I want to change its structure AND the spans, can I "replace" the existing ListGrid within the layout somehow with a (new ListGrid()...)?

      Comment


        #4
        Yes, just remove the old one and add the new.

        Comment


          #5
          To Isomorphic... given your response about my likely need to use CubeGrid to do multi-level spanning headers, does CubeGrid support the programmatic dynamic restructuring I'm looking for in the above post?

          Comment


            #6
            Wow you're fast :-)

            Thanks... I'll check out the ListGrid replacement strategy first.

            Comment


              #7
              CubeGrids are radically different in how they approach data - they are designed for data cubes and have navigation and data visualization features that make sense for cube-like data, but lack things that people expect for lists. So it probably would not make sense to migrate just for multi-level header spans.

              Comment


                #8
                Ah... so you're pushing me towards sponsorship of the Multi-Level HeaderSpans in the ListGrid? ;-)

                Seems like a lot of people would like that feature.

                Comment


                  #9
                  If your data is not cube-like, the CubeGrid could be awkward.

                  It's eligible to be sponsored because multiple people want it, yes. You could be their hero :)

                  Comment


                    #10
                    I will definitely consider it... hero or otherwise :-)

                    In the meantime, the ListGrid replacement strategy is working very well.

                    Thanks!

                    Comment


                      #11
                      I had the replacement ListGrid working when placed/replaced in a simple VLayout container. Now it's not working when I try to make it a Child within a Splitbar.

                      I'm probably using the Splitbar incorrectly, but can't find any usages of it in the Showcase. It's not in the QuickStart Guide, either.

                      I'm going to have two dynamically structured ListGrids, and I want them to be the left and right components of split view. If figured I'd:
                      1. remove the original split view (Splitbar?) instance from my VLayout,
                      2. Completely rebuild the two ListGrids and set them into the split view
                      3. re-add the split view to my VLayout.

                      I'm getting
                      Code:
                      java.lang.IllegalStateException: Cannot change configuration property 'headerSpans' to [Lcom.smartgwt.client.widgets.grid.HeaderSpan;@1f19bf2c after the component has been created.
                      even though my ListGrid is a brand new instance that has never rendered.

                      I've read the JavaDoc for Splitbar, but other than add/removeChild, I can't see the analogous methods to JSplitPane's setLeftComponent/setRightComponent (setTopComponent/setBottomComponent).

                      I've read all I can find to read...

                      Thanks.

                      Comment


                        #12
                        There's no need for direct use of SplitBar, just setShowResizeBar() on members of a Layout. Removing or adding them will automatically manage the required SplitBar.

                        You shouldn't be able to get that error message without it being the same ListGrid - can you show how to reproduce that?

                        Comment

                        Working...
                        X