Announcement

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

    Feature request for ListGrid. Total rows display and filterEditor clear button

    Hi, those are two features I always end up needing in my projects but also in every project I do this in different fashion - never really happy with results. ISC if you decide those features are not going to be added after all pls. give us examples/suggestions on how to do it in the best possible way (with controls placement withing the grid itself)

    1. By default list grid combined with SQL datasource does do count(*) on table so why not just provide option to turn on totalRows visible somwhere on ListGrid?
    2. When you have multiple values typed in into filter editor you always need to ad separate 'Clear filter button' because manually deleting those values is cumbersome. It would be great if this functionality would be provided.

    What do you think?
    Keep up great work guys!

    #2
    Where did you place those options? The problem is that there is no extra space in the grid. Without having the grid take up more space, we thought perhaps:

    1. place the total rows and currently visible rows as a hover on the scrollbar thumb, which also shows and updates as you drag the thumb

    2. place clear filter in the corner menu (top right spot, always visible iff you set leaveScrollbarGap).

    As far as other approaches, we would recommend using ListGrid.gridComponents to add a ToolStrip either above or below the grid proper, and placing information about the current visible rows and total rows there, as well as any other actions you might want to be standard on all grids (eg export) or for a particular grid.

    This approach allows you to create a ListGrid subclass that has this additional functionality, rather than having to wrap ListGrid in some layout component to add the functionality.

    Also, we agree, a sample for this approach would be good.

    Comment


      #3
      for #1, the problem is also that there isn't a a single method to implement/observe which will work for all cases (not that I'm aware of):
      https://forums.smartclient.com/forum...781#post258781

      for #2, there's already the not-so-intuitive context menu on the filterButton, isn't it?

      Click image for larger version

Name:	2020-11-03 10.04.59.jpg
Views:	41
Size:	42.3 KB
ID:	263975

      Comment


        #4
        We've implemented a new sample here that shows the functionality you need.

        Regards
        Isomorphic Software

        Comment


          #5
          Hello, nice sample btw, but updateRowRangeDisplay won't be called after refreshData.

          Comment


            #6
            You seem to be very keen on that, but refreshData() doesn't change the visible row range, so the sample works fine.

            It is true that in the rare case that the dataset length is rapidly changing (like it is a transient queue of some kind), you would potentially have to tell the row range display to update yourself.

            Comment


              #7
              Hi Isomorphic,

              cool new sample. Can you add it in SmartGWT (perhaps here) as well?

              Best regards
              Blama

              Comment


                #8
                Originally posted by Isomorphic View Post
                You seem to be very keen on that, but refreshData() doesn't change the visible row range, so the sample works fine.
                Yes, but updateRowRangeDisplay is also updating the total rows, and that won't be updated.

                I mean it needs this in the click handler of the refresh button:

                Code:
                click: function () {
                    var grid= this.grid;
                    this.grid.refreshData(function(){grid.updateRowRangeDisplay()});
                }
                Last edited by claudiobosticco; 17th Nov 2020, 13:25.

                Comment


                  #9
                  We've enhanced SC 12.1+ to call dataChanged() from refreshData() if the dataset length changes. Other data changes will not trigger dataChanged(), as is pointed out by the updated documentation.

                  Comment


                    #10
                    Nice, thank you very much!

                    Comment

                    Working...
                    X