Announcement

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

    ListGrid and ProgressiveLoading

    Hi Isomorphic,

    I'm using a ListGrid who is connected to a SQLDataSource.
    In the corresponding table, I have more than 200K of records, when the grid is loaded I have the following message
    Code:
    Row count query found 249836 rows, which exceeds the DataSource's progressiveLoadingThreshold of 200000.  Switching to progressive loading mode.
    By reading post in the forum, I understand why.

    What I want, if before doing an operation on the grid, is to check if this one is in progressive loading.
    I try whit this
    Code:
    grid.getProgressiveLoading()
    and this
    Code:
    grid.getDataSource().getProgressiveLoading()
    but the both return null.

    Is there a way to check if the grid is in progressive loading?

    Regards

    Julien

    #2
    We're not really following the gist of the question..

    You can force progressiveLoading to be used, regardless of the detected dataset size, by setting the progressiveLoading property on the DataSource or operationBinding.

    The default behavior, which is what you're experiencing here, is to use progressiveLoading only if there are more rows than the progressiveLoadingThreshold. In this case, the decision to use progressiveLoading is made on the fly, on the server-side, based on the number of records that match criteria, so it definitely can't be known before the dsRequest is performed.

    With this all in mind, let us know if there's still something you need to know about whether progressiveLoading is active, and please let us know what you would do with that information, as that will make it easier to suggest the right approach.

    Comment


      #3
      I had understood that the decision to use the progressiveLoading is made on the fly.

      What I want is to know once the grid is loaded, if this one is loading in progressiveLoading to authorize or not a specific treatment (our business).

      But the once the grid is loaded, grid.getProgressiveLoading() or grid.getDataSource().getProgressiveLoading() return null.

      I was expecting to this return true as there is more than 200k records

      Comment


        #4
        Those methods would be expected to return null, because the progressiveLoading setting on the grid and DataSource is still null.

        If it were set to true, what that would mean is that progressiveLoading will *always* be used, regardless of the dataset size.

        So we are back to:

        With this all in mind, let us know if there's still something you need to know about whether progressiveLoading is active, and please let us know what you would do with that information, as that will make it easier to suggest the right approach.

        Comment


          #5
          Ok.

          I have to do a special treatment on the export on all data returned by the DsRequest used to load the grid.

          But if the total row count exceed 50.000 record, I wand to disable the export and ask to the 'client' to narrow is search to have a total row count less than 50.000 record.

          This export will be accessible on several ListGrid in my application.

          I made a post for the export (http://forums.smartclient.com/showthread.php?t=30429), some days ago, and you had specify to me that
          Code:
          In 5.0, there are new server-side APIs you can implement (DSResponse.hasNextRecord() and nextRecordAsObject()) to implement a streaming export with custom logic like you've shown. You would return a subclass of DSResponse where you have implemented hasNextRecord() and nextRecordAsObject() to call the same APIs on the original DSResponse, but modify the result before returning it.
          As this one is not yet available, I would like to disable the export if there is more than 50.000 record.

          Comment


            #6
            When progressiveLoading mode is used, the grid does not necessarily know the current accurate row count.

            The simplest approach here is that you check the row count when the user attempts an export: do a DataSource.fetchData() call in which progressiveLoading has been explicitly turned off (via the requestProperties argument), using startRow:0 endRow:1 to avoid fetching any actual data - all you want to know is dsResponse.totalRows. At that point if totalRows is too high, tell the user they can't export.

            Comment


              #7
              I have try this and it works good.
              Thanks a lot

              Comment

              Working...
              X