Announcement

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

    ListGrid fetchdata is making 2 calls

    SmartClient : Smartclient v8.2p_2012-06-07 - Power Edition
    Browser : IE 9

    Issue : while making a listgrid.fetchData(criteria,callback,requestProperties) we see that 2 server calls are made which is causing the same sql to execute 2 times. Here is a sample of our listGrid and we call fetchData from multiple places and no matter where it is called we see 2 requests.

    ID: "DummyList",
    width: "100%",
    height: "100%",
    autoDraw:false,
    dataSource: DummyDS,
    autoFetchData: false,
    canHover:true,
    bodyOverflow:"hidden",
    bodyBackgroundColor: "#FFFFFF",
    leaveScrollbarGap: false,
    showFilterEditor:false,
    canSort:false,
    canResizeFields:false,
    canAutoFitFields:false,
    showHeaderContextMenu:false,
    filterOnKeypress: true,
    allowFilterExpressions: true,
    headerHeight: 40,
    dataProperties:{useClientFiltering:false},

    #2
    There are lot of different ways you could cause two requests (one would be calling fetchData() twice).

    If you believe this is due to a framework bug, you should put together a minimal, ready-to-run test case.

    Comment


      #3
      Ok, this is what is happening.

      We implemented pagination using this piece of code (http://forums.smartclient.com/showthread.php?t=22189&highlight=pagination) which works fine as required.

      ListGrid sends startRow and endRow 0, 24 (not sure why 24 since we calculate how many rows it can fit from listgrid height-filter space), but we send response only 16 rows as it can fit only those and set the
      dsResponse.setStartRow(0L);
      dsResponse.setEndRow(list.size()); // 16

      on the fetch callback we see ListGrid trying to make another call to get next set as it is thinking it can fit more... any idea why?

      Comment


        #4
        See the docs for drawAheadRatio and drawAllMaxCells.

        Comment


          #5
          Actually, the issue was happening due to ListGrid's dataPageSize was set
          ListGrid.dataPageSize = pageSize;

          After removing this, it's making only one call. Thanks.

          Comment

          Working...
          X