No announcement yet.
  • 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!

    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.


      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):

      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


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

        Isomorphic Software


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


            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.


              Hi Isomorphic,

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

              Best regards


                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:

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


                  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.


                    Nice, thank you very much!