Announcement

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

    How to limit the number of rows returned from resultset?

    Hello,

    I am new to the smartGWT and I hope I can get some help on the issue that I am facing now.

    I was looking at the "Demo Application"(http://www.smartclient.com/smartgwt/showcase/#featured_complete_app) and I want to know how to control the number of rows to display after "itemList.filterData(findValues);" is executed. Let's say that returns 10 rows but if I want to show just first 5 rows to the "ItemListGrid", how do I accomplish this? It seems I can't intercept that resultset returned. I have tried setDataPagingSize(), but that doesn't seem to help.

    Any help would be greatly appreciated.

    #2
    dataPageSize is correct for controlling retrieval of data. As far as display, just set the grid to the height you want. Consider also autoFitData:"vertical" and autoFitMaxRecords.

    Comment


      #3
      Thank you for the fast reply Isomorphic.

      So, If I want to show just the 5 rows instead of the entire 10 rows that are returned from the datasource, I need to size the listGrid just so it only shows the first 5 rows and hiding the rest of the 5 rows? But, wouldn't a scrollable bar appear if I set the "autoFixMaxRecords"? Also, why is it that the 'dataPageSize" doesn't work? I set it to '0' before "itemList.filterData(findValues);" but, it still displays records.

      One more question...After the call to "itemList.filterData(findValues);", is there a way to intercept the resultset, manipulate it and display the final result to the listGrid? I have tried the "addDataArrivedHandler" to the listGrid....but that doesn't seem to work....Could you help?
      Last edited by test; 30 Nov 2010, 14:53.

      Comment

      Working...
      X