Alright. Looks like we'll just have to figure it out on our own:
Cheers,Code://custom sorting functions for the ranking column // replace "ColumnName" with the name of the column you want to sort // in this case, my column was located at columnIndex 2, adjust to suit your needs function sortNumericASC(a, b) { return Number(a.ColumnName) > Number(b.ColumnName); } function sortNumericDESC(a, b) { return Number(a.ColumnName) < Number(b.ColumnName); } var headerListener = new Object(); headerListener.headerRelease = function(event){ trace("column header num. "+event.columnIndex+" was pressed"); if (event.columnIndex == 2){ if(sortASC == NULL){ sortASC = true; }else{ sortASC = !sortASC; } if(sortASC){ my_dg.sortItems(sortNumericASC); }else{ my_dg.sortItems(sortNumericDESC); } } }; my_dg.addEventListener("headerRelease", headerListener);
John




Reply With Quote