On Mar 15, 6:24 pm, Walter Lee Davis <[email protected]> wrote:
> Since the sort order is a client preference, I would imagine you could  
> stash the client's preferred order in a cookie and use that for return  
> visits. Otherwise, each visitor could override the previous visitor's  
> preference, and you're no further ahead.
>
> Take a look at the LivePipe Cookie extension[1] for Prototype for a  
> really quick way to access the cookie without a lot of gymnastics.
>
> Walter
>
> 1.http://livepipe.net/extra/cookie
>
> On Mar 15, 2010, at 5:56 PM, albert kao wrote:
>
>
>
> > My table columns are sorted by the Tablekit library  
> > (millstream.com.au/
> > upload/code/tablekit/) which run on Prototype.
> > The user can click the columns to toggle the sort order either
> > ascendingly or descendingly.
> > I can save the current sort order (preference) in the server.
> > After the page is refreshed, the web page is sorted by the original
> > sort order.
> > How to make the Tablekit library to sort with the current sort order
> > after page refresh?
> > My web page column is:
> > <th class="sortfirstdesc" id="urgency"
> > onClick="reverseOrder($sortdesc)">ID</th>
>
> > --
> > You received this message because you are subscribed to the Google  
> > Groups "Prototype & script.aculo.us" group.
> > To post to this group, send email to 
> > [email protected]
> > .
> > To unsubscribe from this group, send email to 
> > [email protected]
> > .
> > For more options, visit this group 
> > athttp://groups.google.com/group/prototype-scriptaculous?hl=en
> > .

To ensure my program keep the client preference after page refresh, do
I do this:
var value = Cookie.get('key');
if (value == null) {
    // get  the client preference
    // ...
    // save  the client preference
    Cookie.set('key', 'uservalue');
}
// use the client preference

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to