PagingMemoryProxy doesn't obey SortInfo

  1. #1

    PagingMemoryProxy doesn't obey SortInfo

    I have had issues with sorting of elements in a DataView that seems to only appear if I associate a PagingToolbar with the store that is feeding the DataView. After a bit of looking, I found that the PagingToolbar creates a PagingMemoryProxy for the store which doesn't look at the SortInfo object ... it only looks at params.sort, which seems to only be set by grids...
  2. #2

    RE: PagingMemoryProxy doesn't obey SortInfo



    I take it back... the PagingMemoryProxy seems to sort the Store's elements on a page by page basis. That is, it pages and then sorts - when it should actually sort and then page.

    Since my Store is entirely on the client:
        <ext:Store runat="server" ID="Store1" AutoLoad="true">
            <Reader>
                <ext:JsonReader>
                    <Fields>
                        <ext:RecordField Name="id" />
                        <ext:RecordField Name="name" />                   
                    </Fields>
                </ext:JsonReader>
            </Reader>
            <SortInfo Field="minhost" Direction="ASC" />
            <AutoLoadParams>
                <ext:Parameter Name="start" Value="0" Mode="Raw" />
            </AutoLoadParams>
        </ext:Store>
    I would certainly expect sort then page.
  3. #3

    RE: PagingMemoryProxy doesn't obey SortInfo

    Interesting find.

    We'll look into this and come up with a fix.


    Geoffrey McGill
    Founder
  4. #4

    RE: PagingMemoryProxy doesn't obey SortInfo



    I tried to make that code generic, and ended up missing one spot. The "minhost" reference in sortinfo is actually "name".

    Also, the store has remoteSort = false.
  5. #5

    RE: PagingMemoryProxy doesn't obey SortInfo

    The sample attached to http://forums.ext.net/showthread.php?4385 is a pretty good demo of this sorting issue.
    Last edited by geoffrey.mcgill; Feb 20, 2011 at 3:07 PM.
  6. #6

    RE: PagingMemoryProxy doesn't obey SortInfo

    Hi,

    You need to set RemoteSort="true" for Store. It will force to move the sort params to the proxy
  7. #7

    RE: PagingMemoryProxy doesn't obey SortInfo

    Thanks Vladimir that worked perfectly!

    The name "RemoteSort" doesn't really indicate to me that it would push sorting to the client... perhaps this should be called "ClientSort"?
  8. #8

    RE: PagingMemoryProxy doesn't obey SortInfo

    Hi,

    RemoteSort means that sorting will be performed outside the Store (in proxy like PagingMemotyProxy or sort params will be moved on server side like in HttpProxy).


    If RemoteSort="false" the sorting will by performed by Store (on client side)
  9. #9

    RE: PagingMemoryProxy doesn't obey SortInfo

    Thanks for the clarification.

Similar Threads

  1. [CLOSED] Change GridPanel SortInfo from code behind
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: May 10, 2011, 6:33 AM
  2. Store.OnRefreshData and SortInfo
    By Awrong in forum 1.x Help
    Replies: 1
    Last Post: Dec 30, 2009, 6:04 AM
  3. Setting SortInfo dynamically
    By lionelhutz in forum 1.x Help
    Replies: 4
    Last Post: Oct 06, 2009, 10:35 AM
  4. Error when setting store.SortInfo in codebehind
    By plykkegaard in forum 1.x Help
    Replies: 0
    Last Post: May 19, 2009, 4:57 PM
  5. [CLOSED] SortInfo tag in Store
    By Jurke in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Oct 17, 2008, 7:39 AM

Posting Permissions