Welcome, Guest
  • Author Topic: Datagrid sort issue with paging  (Read 2183 times)

    halostars

    • Server what's that
    • *
    • Posts: 10
      • View Profile
    Datagrid sort issue with paging
    « on: 06/02/06, 13:51 »
    Hello,

    I am using amfphp to query my database, return a recordset, and assign it to my datagrid. The recordset doesn't get displayed all at once, but in increments of 10 as the user scrolls down. My problem is, when I click on the datagrid's column headers BEFORE all the results are in the database, the datagrid won't sort. It only sorts after the user has scrolled down all the way and all records are in.

    This is a problem because potentially there will be 100's of records, and I don't want to force the user to load all of them to be able to sort through them. So, anyone have any suggestions? I think that the way paging is working, the recordset's contents are just temporary until all records are in. So I am worried that if I sort on the temporary recordset and then the user gets a new page of data it will replace the sort. Anyone dealt with this before?

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Datagrid sort issue with paging
    « Reply #1 on: 06/02/06, 14:52 »
    Are you loading all records, or just a portion? (using pageable recordset or just an sql LIMIT)

    Jorge

    halostars

    • Server what's that
    • *
    • Posts: 10
      • View Profile
    Re: Datagrid sort issue with paging
    « Reply #2 on: 06/02/06, 19:14 »
    I am using a Pageable Recordset and I set the delivery mode to 'page' in the result handler -- I pretty much followed the example on amfphp.org.
    « Last Edit: 06/02/06, 19:25 by halostars »

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re: Datagrid sort issue with paging
    « Reply #3 on: 06/04/06, 08:06 »
    In this case the grid cannot sort, because it does not have all the records.
    But you can write a function calling the database again to make the database sort the records in the way the user asks it to and deliver then pagable records in the right order.
    This means another roundtrip to the server, but is propably much more responsive to your user than loading all the records to make the grid do the sort.
    happy flashing
    8)
    Ronald