Announcement

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

    Periodically refreshable ListGrid

    v10.0p_2015-02-11/LGPL Deployment (built 2015-02-11)
    Chrome 42.0.2311.135

    Hi,

    My data continuously changing, so I need to refresh grid to show new data. Of course, it should be transparent, so InvalidateCache is not an option. There is quite a lot data(about 15-20 columns and 10k rows), so transparent paging is also required. Data fetched from server with custom DataSource, based on RestDataSource.
    I've tried example from SmartClient Wiki https://isomorphic.atlassian.net/wiki/pages/viewpage.action?pageId=525074 (there was other problems with that example, but I already fix it), but have troubles with synchronizing refresh requests with filter/paging requests in case of high latency(due server load).

    For example:
    1. Refresh tick create and send request.
    2. User change grid filter
    3. Filter event create and send request
    4. Refresh response received and processed
    At this point grid data conflicts with filter values
    5. Filter response received and processed, but grid data not changed, because of replaced result set(at previous step).

    Do you have an idea how to fix this bug? Or other solution for transparent refreshing?
    Maybe there is a way to correct refreshing in more advanced editions?

    #2
    We're not sure if this is a trick question in some way, but the obvious solution is to not apply the refresh data if the grid has made another fetch (due to changed filter criteria or sort).

    One way to detect such requests would be to add a transformRequest method on the DataSource.

    Note that the refreshData() API, added as a convenience in SC 10.1, automatically handle this.

    Comment


      #3
      Thanks for quick reply.

      Sorry, looks like I'm not very clear. Yes, of course, solution is just abort refresh request in case of new fetch requiest, and I expect to hear some kind of tip, where I can place such logic(some kind of hook).

      Using transformRequest, will be not entirely correct, because multiple grids are using same DataSource, but yes, it could be used with some workaround.

      refreshData looks great, exactly what I want, thanks for the help.

      Comment


        #4
        dsRequest.componentId allows you to determine what component the request came from.

        Comment

        Working...
        X