Announcement

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

    Display data in ListGrid with specific number of rows

    Hi Isomorphic,

    I purchased smartGWT Power Ed. 2.4 to use with Windows XP Pro and GWT 2.3, Java 1.6 (I'm not using JS)

    I have large data in DB and I'd like to display specific number or rows in ListGrid table. The request displayed number of rows is come from Client site.

    My questions are:

    1. How could I display data with a specific number for rows (the requested number of rows come from Client) to ListGrid.

    2. How could I pass requested displayed number of rows to Server site.

    3. How can I implement the 'Next' link, so that, when the user click 'Next'; the ListGrid will display the next block of number of rows.
    For example, I have 1000 rows of data after fetch() and ListGrid is set to display 25 rows by default. When user click 'Next' the ListGrid will display the row 26 - 50 (of 1000 rows), and so on.

    Thanks in Advance,

    #2
    Use dsRequest.startRow and dsRequest.endRow to request specific ranges of rows.

    Comment


      #3
      Thanks Isomorphic,

      How do I implement the 'Next' callback to display the next page of data rows ?

      Comment


        #4
        Not sure what the question is.. any time you want to a fill a grid with a specific set of rows, issue a DSRequest with startRow/endRow set, then in the callback, use setData() to put this data in the grid.

        Just a note that this is a very manual way of doing things - the grid automatically loads data on demand when scrolling. It would be a very rare circumstance where you would want to implement a pattern like you describe, and you may actually be doing extra work to produce a poorer interface.

        Comment


          #5
          My question is just like this Isomorphic site, the '1', '2', ...'Next' at lower right corner. Mine is small screen with large number of rows, so I'd like to implement the 'next', 'previous' at the bottom of list grid.
          As you mentioned, I can use request.startRow/endRow to tell the Data Source to load only specific number of rows, and how I implement the feature so that when user want to see the next block of rows (when user click 'Next' on the client view).

          thanks,

          Comment

          Working...
          X