1. #1
    Ext JS Premium Member
    Join Date
    Mar 2007
    Location
    Virginia, USA
    Posts
    220
    Vote Rating
    0
    dfenwick will become famous soon enough

      0  

    Default Sort direction and sort images

    Sort direction and sort images


    2 bugs in the visual portion of the sorting:

    1) The first time the grid is loaded, there is no sort graphic indicator present on the grid. Changing the sort order by clicking a header then displays the sort indicator. I've tried using the setDefaultSort() member function, but it doesn't change anything.

    2) When clicking on a column header to change the sort, there is some confusing behavior. When it's first clicked, it sorts ascending. When you click again on the same column header, it sorts descending. That's all correct. The bug appears to be persistence attached to a column after you've already sorted it. After a fresh refresh of a grid, with Col1 being the default sort column, it comes up sorted ascending on Col1. If you click on Col2 it then sorts ascending for Col2. If you then click on Col1 again, it should set it back to Col1 being sorted ascending, but it actually sorts it descending (looks like it remembers the previous state of the column and flips it as it were the current column.) The column sort should remember its last sort order and resume that sort if it's not the currently sorted column.

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

      0  

    Default


    1) If you don't supply a default sort, then it isn't sorted and no sort indicator is given. That is the correct behavior.

    I need info on how setDefaultSort isn't working. A code example or a page. I am using it in the examples and it's works as expected. Just saying it's broken doesn't give enough info.

    2) I agree, that is bad logic. I will fix it in this release.

    Jack

    Edit: #2 is fixed. The fix will be in the coming release.

  3. #3
    Ext JS Premium Member
    Join Date
    Mar 2007
    Location
    Virginia, USA
    Posts
    220
    Vote Rating
    0
    dfenwick will become famous soon enough

      0  

    Default


    From the example you posted, I added the default sort method. I'm assuming it's in the right place, which is pre-rendering. Whether I supply a default sort or not, it doesn't display the sort graphic until I actually click the column header.

    If I'm doing something incorrectly, please let me know.

    Code:
          // create the Grid
            this.grid = new YAHOO.ext.grid.Grid('grid-example', dataModel, colModel);
            dataModel.setDefaultSort(colModel, 1, 'ASC');
            var start = new Date().getTime();
            this.grid.render();
            var end = new Date().getTime();
            //alert('Rendered in ' + ((end-start)/1000) + ' seconds');
            this.grid.getSelectionModel().selectFirstRow();

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

      0  

    Default


    Ah, I think I know what the problem is. You are using an array DataModel not Ajax style right?

    The default sort was created for async loaders, where calling sort directly isn't an option since there's nothing to sort initially. With an array DM there's no need for a default sort, you can just call sort directly.

    Code:
    //dataModel.setDefaultSort(colModel, 1, 'ASC'); 
    dataModel.sort(colModel, 1, 'ASC');

Similar Threads

  1. Bug on sort after move columns
    By galdaka in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 14 Mar 2007, 6:02 AM
  2. grid stable sort
    By ericwaldheim in forum Community Discussion
    Replies: 5
    Last Post: 29 Nov 2006, 7:26 AM
  3. Sort order backwards??
    By tryanDLS in forum Ext 1.x: Bugs
    Replies: 8
    Last Post: 10 Nov 2006, 7:27 AM
  4. Hello, sort anoob here
    By Nanbe1st in forum Ext 1.x: Bugs
    Replies: 0
    Last Post: 14 Oct 2006, 1:49 AM

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar