Announcement

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

    onGroupStateChanged handler not always being called for ListGrid?

    Hi,

    I was wondering if this is a known issue where onGroupStateChanged is not called every time? After creating my ListGrid, I used:

    Code:
    grid.setGroupByField("Block_Name");
    
    grid.addGroupByCompleteHandler(new GroupByCompleteHandler(){
    
                @Override
                public void onGroupByComplete(GroupByCompleteEvent event) {
    onGroupByComplete is called the first time due to grid.setGroupByField() seen above.

    I have a button that uses grid.setData() to change the datasource, when the user presses the button. This also has the effect of refreshing the grid. Since grouping was already set, it then correctly groups the data. However, the onGroupByComplete event is never seen again.

    After some time I discovered the workaround to call grid.groupBy("Block_Name") in the button click handler after changing the datasource, and then onGroupByComplete event is correctly seen. But this seems unnecessary because the data was already being grouped before doing this, but the callback wasn't working. Is this a framework bug? Thanks for your time.
    Last edited by user316; 5 Jan 2016, 08:31.

    #2
    You mention both onGroupStateChanged and groupByComplete by the way.
    Regardless - these notifications are fired when the specified grouping on a grid changes (new group fields, etc) and the grouping operation completes.
    You can probably use dataChanged if you're looking for a notification for the data changing in an already grouped grid.

    If you have a use case where this seems inappropriate / makes it difficult to achieve your desired results, please do let us know and we'll consider whether there's anything to improve or clarify here.

    Thanks
    Isomorphic Software

    Comment


      #3
      Originally posted by Isomorphic View Post
      You mention both onGroupStateChanged and groupByComplete by the way.
      Regardless - these notifications are fired when the specified grouping on a grid changes (new group fields, etc) and the grouping operation completes.
      You can probably use dataChanged if you're looking for a notification for the data changing in an already grouped grid.

      If you have a use case where this seems inappropriate / makes it difficult to achieve your desired results, please do let us know and we'll consider whether there's anything to improve or clarify here.

      Thanks
      Isomorphic Software
      I meant to say onGroupByComplete .

      Changing the datasource of a grid causes it to refresh and regroup the new data (it even pops up a dialogue saying grouping). Shouldn't this make the onGroupByComplete() handler be called again? I think it would make more sense if the handler was called every time the data is grouped.

      Comment


        #4
        I was wondering if there is an update on this? It isn't urgent but I would like to see the resolution. Thanks

        Comment

        Working...
        X