Announcement

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

    ListGrid asks DataSource for startRow=0, endRow=1000 on initial fetch request

    I'm using SmartGWT 2.3 and GWT 2.0.4 and Firefox 3.6.

    I have a ListGrid backed by a DataSource, which fetches records from the server via GWT-RPC. The data page size on the grid is set to 50. I set the grid to auto fetch data and set some initial criteria, i.e.:

    listGrid.setAutoFetchData(true);
    listGrid.setInitialCriteria(nonNullInitialCriteria);

    I then notice when the grid makes the initial automatic fetch request, it sets the endRow on the DSRequest to 1000, rather than 50 (the grid's data page size) as I would have expected. This is not desirable since it loads way more data than necessary and makes it to take longer for the initial data to show up in the grid. On subsequent fetch requests, the grid asks for 50 rows as it should. At first I thought this was being caused by the groupByMaxRecords field on ListGrid, since its default value is 1000. So I tried both of the following:

    listGrid.setGroupByMaxRecords(50);
    listGrid.setCanGroupBy(false);

    but neither of these made a difference. It continued to request 1000 records on the initial request.

    I found that 1000-record fetch request only happens when both of the following are true:

    1) initialCriteria != null
    2) autoFetchData == true

    So I worked around the issue by turning off autoFetchData and manually calling fetchData() where needed, but I would still like to know why it was occurring. It seems like a bug to me, since nowhere did I tell the ListGrid to ever ask the DataSource for 1000 records.

    Note, I did not set the drawAheadRatio or the quickDrawAheadRatio fields on the grid.

    #2
    The settings you describe, on their own, do not seem to cause this behavior. If you believe these settings are at fault, then can you take one of the provided samples, and minimally modify it to reproduce a problem like this?

    Comment

    Working...
    X