1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    27
    Vote Rating
    1
    SLerman is on a distinguished road

      1  

    Default Clear grid's sort arrow icon

    Clear grid's sort arrow icon


    I added a click handler to the paging toolbar's reset button (nice addition in 1.0, by the way) that changes the remoteSort to true and the sort column to 'default' to make it be a complete reset. It seems to work quite well, except that the arrow icon in the column header isn't cleared out after the grid reloads. Would this be considered a bug, or is there some function I can call manually to remove the arrow?

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    17
    jack.slocum will become famous soon enough jack.slocum will become famous soon enough

      0  

    Default


    There's no way for it to know that the sort changed unless you tell it. There are two ways, and if way 1 (below)doesn't work I will post a longer way that is sure to work.

    Code:
    grid.getView().updateHeaderSortState();
    Note, this will only work if you actually updated the sortInfo property on the data store.

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    27
    Vote Rating
    1
    SLerman is on a distinguished road

      0  

    Default


    Just calling that function doesn't work, since I'm setting the sortInfo.field to a non-existent column ('default', which is the order determined by the script that returns the data). I looked inside that function, though, and found the line that I need to just remove the arrow:

    Code:
    grid.getView().el.select(grid.getView().headerSelector).removeClass(grid.getView().sortClasses);
    Not sure if changing updateHeaderSortState() to just remove the arrow if sortInfo.field doesn't exist is something you'd want to do.[/code]

  4. #4
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    17
    jack.slocum will become famous soon enough jack.slocum will become famous soon enough

      0  

    Default


    That was going to be my second suggestion.

    Local variables are always a good idea.

    Code:
    // grid.getView().el.select(grid.getView().headerSelector).removeClass(grid.getView().sortClasses);
    
    var view = grid.getView();
    view.el.select(view.headerSelector).removeClass(view.sortClasses);

  5. #5
    Ext User
    Join Date
    Nov 2007
    Posts
    25
    Vote Rating
    0
    petchia is on a distinguished road

      0  

    Default reset grid columns in EXT 2.0??

    reset grid columns in EXT 2.0??


    I am trying to programmatically reset a grid in EXT 2.0 using both of the methods mention in this thread and have not had any luck.

    I noticed that the posts in this thread are quite old and am hoping there is a "newer, better" way to reset sort column headers programmatically.

    Any ideas?

  6. #6
    Ext User
    Join Date
    May 2008
    Location
    Harrogate, North Yorkshire
    Posts
    20
    Vote Rating
    0
    Damian Ibbotson is on a distinguished road

      0  

    Default


    This worked for me:
    Code:
    grid.getView().updateHeaders();

  7. #7
    Sencha User
    Join Date
    Jun 2008
    Posts
    14
    Vote Rating
    0
    linuxguy2001 is on a distinguished road

      0  

    Lightbulb This works

    This works


    Say you want to reset the grid data via a reset button located somewhere on your form, just add this handler to your button:
    Code:
    handler : function() {
                                    myGrid = Ext.getCmp('mygrid_id');     
                                    
                                    // Removes any sorting done to the grid
                                    delete myGrid.store.sortInfo;
                                    
                                    myGrid.store.reload({
                                                        params: {
                                                                start:0, 
                                                                limit: 150
                                                                }      
                                                                      }); 
                                }

Similar Threads

  1. clear grid totaly
    By emi in forum Ext 1.x: Help & Discussion
    Replies: 10
    Last Post: 25 Apr 2012, 10:28 AM
  2. use arrow keys when editing a grid cell?
    By chachi in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 28 Mar 2007, 6:51 AM
  3. Fire clear event when Store is empty?
    By aconran in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 22 Feb 2007, 4:39 PM
  4. using keyboard (arrow up/ down) in grid with FF?
    By franklt69 in forum Ext 1.x: Help & Discussion
    Replies: 15
    Last Post: 6 Feb 2007, 6:00 AM
  5. Sort direction and sort images
    By dfenwick in forum Ext 1.x: Bugs
    Replies: 3
    Last Post: 20 Sep 2006, 11:53 PM

Thread Participants: 4

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi