[CLOSED] Custom GridPanel Sorting

  1. #1

    [CLOSED] Custom GridPanel Sorting

    Hi,

    I have a grid with N columns, and only one of these is sortable. I want to perform a custom order when user order this column.

    When I say custom order, it means that sortable column is field "X" and in my sort function I want to to use columns "Y and "Z" that are fields of model, but not visible columns for example.

    Is there a way to perform this?

    I'm using Ext.NET 2.1 r4377 (ExtJS 4.1.3)
    Last edited by Daniil; Jun 10, 2013 at 3:41 PM. Reason: [CLOSED]
  2. #2
    Hi @softmachine2011,

    It should be possible via remote sorting. To enable it please set up RemoteSort="true" for a Store.
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi @softmachine2011,

    It should be possible via remote sorting. To enable it please set up RemoteSort="true" for a Store.
    Yes I know, I forget to tell you that this rows are generated in client side, then sort must be performed in client side.
    I was investigating and I found that you can create something like this in store model

    <ext:ModelField Name="MyField" Type="Int" UseNull="true">
                                            <CustomSortType Fn="MyCutomSortTypeFn" />
                                        </ext:ModelField>
    Is this what I'm looking for? If yes, how it is used?
    I see that, only column value is received by sorter function...
  4. #4
    Here is an example for Ext.NET v1.
    http://forums.ext.net/showthread.php?12152#post49619

    I think it should be similar in Ext.NET v2 (but, probably, not exactly the same).

    Hope this helps.
  5. #5
    Like I say in previous post, CustomSortType only pass column value as argument and I need another column value to define order.
    I think that CustomSortType isn't what I'm looking for, is there another way to do it?
  6. #6
    Yes, you are right, there is only a value available.

    I think you should implement custom sorting by switching off default sorting. Then catch a header click (a ColumnModel's HeaderClick event) and sort the data by calling a Store's sort method, passing custom sorters.
    http://docs.sencha.com/extjs/4.2.1/#...re-method-sort

    Hope this helps.
  7. #7
    Thanks daniil, I could do it with store sort method.

Similar Threads

  1. [CLOSED] Custom Grid Sorting
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 15
    Last Post: Oct 24, 2013, 4:15 AM
  2. Replies: 0
    Last Post: Feb 05, 2013, 8:12 AM
  3. Gridpanel custom sorting
    By boris in forum 1.x Help
    Replies: 11
    Last Post: Aug 23, 2011, 2:50 PM
  4. Problem with GridPanel sorting
    By magisystem in forum 1.x Help
    Replies: 3
    Last Post: Sep 09, 2010, 1:35 PM
  5. [CLOSED] Sorting Disabled in GridPanel
    By speedstepmem3 in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Jul 07, 2010, 11:37 AM

Tags for this Thread

Posting Permissions