:: Forum >>

Sort column ascending/descending?

Thanks in advance for the help.

How do I change the column sort to descending?

As it is, first click is ascending and second click is descending

Thanks

Dave
Dave
Tuesday, January 24, 2006
Dave, if you do a search of the forum for either ascending or descending, you will find quite a few examples on how to change the sort order programatically. One of them should do the trick for you.
Jim Hunter
Tuesday, January 24, 2006
I did a forum search for descending there were 3 questions none of which are answered.

I did a forum search for ascending there were 4 questions none of which provided a solution that works.


The closest thing is this...but It did not work for me...?

this.setSortColumn(index);
this.setSortDirection("ascending", index);
Dave
Tuesday, January 24, 2006
To clarify my question....

I would like the sort order to be descending on the first click of the column.


Thanks again for any further help

dave
Dave
Tuesday, January 24, 2006
I figured it out!.....


I went into the aw.js file and changed ascending to descending and descending to ascending in the selection below...





This is with the changes to sort column descending on the first click



var direction=this.getSortDirection(index);if(direction !="descending"){direction="descending"}else{direction="ascending"}if(src=="descending"

|| src=="ascending"){direction=src}var i,value={},pos={};var offset=this.getRowOffset();var count=this.getRowCount();var

rows=this.getRowIndices();if(offset){}if(!rows){rows=[];for(i=0;i<count;i++){rows[i]=i+offset}}else{rows=rows.slice(offset,offset+count)}f

or(i=0;i<rows.length;i++){value[rows[i]]=this.getCellValue(index,rows[i]);pos[rows[i]]=i}rows.sort(compare(value,pos,direction));var

a=[];for(i=0;i<offset;i++){a[i]=i}rows=a.concat(rows);var old=this.getSortColumn();if(old

!=-1){this.setSortDirection("",old)}this.setSortColumn(index);this.setSortDirection(direction,index);this.setRowIndices(rows)},onHeaderCli

cked:"doSort"};
Dave
Wednesday, January 25, 2006
Mmmhhhh.... It doesn't seem to be working for me. Except for the curson icon (that is right) the column sorts in ascending order first...
Diabolik
Wednesday, March 15, 2006

This topic is archived.


Back to support forum

Forum search