Announcement

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

    getTotalRows() constantly returning 1000

    Greetings,

    I'm using 7.0rc2. I've got a list grid with autoFetchData:true. I do an RPC call, then listgrid.fetchData(). On the servlet side, I setTotalRows() to the correct number. In other areas of my app this works perfectly. However, on this one grid, when I do a listgrid.getTotalRows(), it returns 1000 every time. I've checked the RPC response in the developer console, and "totalRows:" is set correctly, and it's never 1000. listgrid.data.getLength() returns the same number.

    What would make listGrid.getTotalRows() return 1000 every time?

    Code:
    switch(rpcResponse.status)
    {
    	case 0: //Search successful and results are there
        	<%-- Configure search list results grid --%>
        	searchResultsList.setCriteria(criteria);
    	searchResultsList.setFields(rpcResponse.data);
    	searchResultsList.invalidateCache();
    	quickSearchTabSet.setHeight(companyDetailHeightMax);
    	quickSearchTabSet.selectTab(6);
    
      	portfolioSelectList.getItem('portfolio_name').fetchData();
        	portfolioSelectList.show();
        	searchResultsLabel.setTop(150);
        	searchResultsLabel.setContents("Search for '" + simpleSearchForm.getItem('companyQuickSearchField').getValue() + "' returned " + searchResultsList.getTotalRows() + " companies.");
        	searchResultsLabel.show();
        	//portfolioListLayout.show();    		
    			
        	break;
    Thanks,
    S

    #2
    fetchData() is asynchronous. While data is loading, this "marker value" of 1000 will be returned. See ResultSet.lengthIsKnown() for how to detect this state - use the callback for fetchData() or the DataArrived event to wait to perform actions until data has been loaded.

    Comment


      #3
      Ah, I should have thought of that. That makes perfect sense. I'll put it in data arrived or in the callback.

      Thanks

      Comment

      Working...
      X