Greg Hains Posted May 17, 2007 Posted May 17, 2007 Hi. I have a column that I want users to be able to click the column header and toggle between the data sorting ascending and descending. I know that two seperate buttons will do the trick, but want to know if there's a way I can either detect a columns sort status, or have some sort of toggled status I can refer to to then run a script. Any ideas please? Greg
Reed Posted May 17, 2007 Posted May 17, 2007 Is this in a portal or on a list layout? If it's a list layout you would simply call a script to sort the records, and then set a flag as "ascending" or "descending" When you call the script again, just branch the script to sort the opposite way and reset the flag. Open one of the built-in templates and look at the scripts used for sorting the list view If you're sorting a portal, then it's trickier, but there are many methods if you search the forums for portal sorting.
Greg Hains Posted May 17, 2007 Author Posted May 17, 2007 Hi. Its a list Im sorting. Please explain how I can setup, toggle, and then subsequently read this flag. Thanks for your response by the way. Greg
Genx Posted May 17, 2007 Posted May 17, 2007 If[ $$sortOrder = "Asc" ] Sort Records[ do your descending sort here ] Set Variable[$$sortOrder ; "Desc" ] Else Sort Records [ do your ascending sort here ] Set Variable[ $$sortOrder ; "Asc" ] End If You can then at any time retrieve your current sort order as it is stored in the $$sortOrder variable.
Greg Hains Posted May 17, 2007 Author Posted May 17, 2007 Many thanks for your help. I should be able to take it from here. Greg :)
Recommended Posts
This topic is 6401 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now