Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Aug 2008
    Posts
    226
    Vote Rating
    2
    TheBuzzer is on a distinguished road

      0  

    Default Unanswered: Default column for sort in grid?

    Unanswered: Default column for sort in grid?


    I am wondering how do you make a column as the sorted column SortDir.ASC or SortDir.DESC by default when the grid first load?

  2. #2
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    411
    Answers
    20
    Vote Rating
    21
    icfantv will become famous soon enough icfantv will become famous soon enough

      0  

    Default


    Are you talking about making the little triangle thingy appear or to set the default sorting?

    If the latter, that is set when your grid makes the call to your, say, RpcProxy. In our server side code, we get a FilterPagingLoadConfig object, convert that to a SearchCriteria and pass that along to our business logic and DB routines. This method returns a ListLoadResult object which contains, amongst other things, the SortInfo (which contains the sort direction).

  3. #3
    Sencha User
    Join Date
    Aug 2008
    Posts
    226
    Vote Rating
    2
    TheBuzzer is on a distinguished road

      0  

    Default


    the little triangle thing, i know how to get the sort info however when the grid first load, i want it to be able to have it sorted in a certain way by default.

    i tried to mess with the store but that caused arrow to appear but wacked the server side sorting.

  4. #4
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    411
    Answers
    20
    Vote Rating
    21
    icfantv will become famous soon enough icfantv will become famous soon enough

      0  

    Default


    I don't know of a way to automagically make that arrow appear, but it sounds like you found one. The only thing you'll need to do is account for the initial request to the server from the grid for data.

    In our case, the initial request from the grid has empty SortInfo so we use that as a smoke screen to discern between the initial and subsequent requests. In our case, however, we do not care about the missing triangle. I would think that good UI design dictates that the first column is sorted by default but clearly, every use case is different.

  5. #5
    Sencha User
    Join Date
    Oct 2008
    Posts
    11
    Vote Rating
    0
    kaefert is on a distinguished road

      0  

    Default


    I too would be interested to know how to programatically set the sort column to the grid, in a way that also makes the little triangle show up.

    Manipulating my loadProxy or my server side code to manipulate the sorting is not a problem, but that doesn't give me the little triangles

  6. #6
    Sencha User
    Join Date
    Aug 2011
    Posts
    1
    Vote Rating
    0
    Sergeyy is on a distinguished road

      0  

    Default


    Try to use:
    store.setDefaultSort("column_id", SortDir.ASC);

  7. #7
    Sencha User
    Join Date
    Oct 2008
    Posts
    11
    Vote Rating
    0
    kaefert is on a distinguished road

      0  

    Default


    I'm using GXT 3.0.1, and the ListStore implementation that I get when I call grid.getStore() does not have a method called "setDefaultSort"..

  8. #8
    Sencha User
    Join Date
    Mar 2013
    Posts
    1
    Vote Rating
    0
    mportela is on a distinguished road

      0  

    Default workarround for this... here using ext 4.0.7 ...

    workarround for this... here using ext 4.0.7 ...


    Here i have made a workaround for this

    As i have binded a store to the grid that was remote sorted, the grid don't show that little triangle in the column, so i go down to the specific column object, in my "initComponent" code of my view and do this trick calling this method on the column :

    setSortState('DESC', undefined, true)

    You can change the DESC for ASC if you want... but keep the "true" parameter... because without that, the grid will try do load the store as if an user clicked in the header of the grid to sort...

    Hope this helps...
    Marcel Portela

  9. #9
    Sencha User
    Join Date
    Feb 2010
    Posts
    353
    Answers
    14
    Vote Rating
    4
    maneljn is on a distinguished road

      0  

    Default


    You can do it like this

    Define the store with any default "sorters"

    Code:
            // ---------------------------------------------------------------
            // Asignar el store (Forzamos la creación de un objeto nuevo)
            // ---------------------------------------------------------------
            me.store = Ext.create('ispgest.store.dominios', {
                storeId: Ext.id(),
                // Hay que filtrar la información por la empresa seleccionada
                filters: [{
                    id: 'domi_empresa_id',
                    property: 'domi_empresa_id',
                    value: ispgestApp.empresaActualId
                }],
                sorters: [{
                    property: 'domi_nombre',
                    direction: 'asc'
                }]
            });
    In AfterRender event of the grid put this
    Code:
    ...
        onAfterRenderGrid: function( grid, eOpts) {
            var me = this;
    
            // Procesos que se realizan cuando se acaba de crear/dibujar el control grid del mantenimiento    
            
            // Marcar la columna por la que el store tiene un "sorter" local (si lo tiene)
            var store = grid.getStore();
            if (store) {
                var storeSorters = store.getSorters();
                if (grid.columns.length>0 && storeSorters.length>0) {        
                    Ext.each(grid.columns, function(column, index) {
                        if (grid.columns[index].dataIndex == storeSorters[0].property) {
                            grid.columns[index].setSortState(Ext.util.Format.uppercase(storeSorters[0].direction));
                        } else {
                            grid.columns[index].setSortState(null);
                        }
                    });        
                }
            }
            
        }
    ...
    -------------------
    Manel Juàrez

  10. #10
    Ext GWT Premium Member icfantv's Avatar
    Join Date
    Sep 2011
    Location
    Superior, CO
    Posts
    411
    Answers
    20
    Vote Rating
    21
    icfantv will become famous soon enough icfantv will become famous soon enough

      0  

    Default


    @mportela and @maneljn, this is a GXT forum, and your response was for EXT JS. Please take a few seconds to look before posting. Thanks.

    To get the arrow to display in the column header, see this link: http://www.sencha.com/forum/showthread.php?260264