Sorted Table and Back Button

S

scott_us

I have a html web page with a table and sorting function in it. When
users click one of the column header of the table, it will sort the
table. Also there are some links in the table. People can click the
links to go to a new page in the same window. The problem is that the
window will never come back to the sorted status after a user hit the
back button of the browser. It come back to a default status. That is,
a unsorted table in my case.
I would like to know if there is any solution? thanks.
 
J

Jonathan N. Little

scott_us said:
I have a html web page with a table and sorting function in it. When
users click one of the column header of the table, it will sort the
table. Also there are some links in the table. People can click the
links to go to a new page in the same window. The problem is that the
window will never come back to the sorted status after a user hit the
back button of the browser. It come back to a default status. That is,
a unsorted table in my case.
I would like to know if there is any solution? thanks.

Depends on how your are rendering the page, and preserving the state.

URL???
 
S

scott_us

Jonathan,
Thanks for your response. Indeed, the problem is very easy to
duplicate. If you have a Yahoo email account, you will see that all
your emails are sorted by Dates when you open the Email Inbox. You may
sort them by clicking Sender, Subject,.... Suppose if you sorted all
your email by Sender. Then open one of the emails which let you read
its content. After you have done, you click the back button of your
browerser. It will take you back to the mail index. But all mails are
still sorted by Sender. However, I could not duplicate the feature in
my website. I always get the index by Dates which is the first time a
user opened.
Please let me know if you have any idea to fix a java script file or
html file to have this feature.
Thanks.
Scott
 
J

Jonathan N. Little

scott_us said:
Jonathan,
Thanks for your response. Indeed, the problem is very easy to
duplicate. If you have a Yahoo email account,

I don't.
you will see that all
your emails are sorted by Dates when you open the Email Inbox. You may
sort them by clicking Sender, Subject,.... Suppose if you sorted all
your email by Sender. Then open one of the emails which let you read
its content. After you have done, you click the back button of your
browerser. It will take you back to the mail index. But all mails are
still sorted by Sender. However, I could not duplicate the feature in
my website.

When is asked, "URL????" That was a request for a url to your website so
one can actually 'see' how you are trying to accomplish this.
I always get the index by Dates which is the first time a
user opened.
Please let me know if you have any idea to fix a java script file or
html file to have this feature.

Well it would not (should not) be done client-side, so JavaScript will
not be your answer but the CGI script (PHP, Perl, Python, whatever) you
are using to create the page and populate the table. Methods would be
via cookie, session or query string. It is how Yahoo does it and if you
are not using server-side scripting that maybe where your problem lies.
Of course if you would supply us a with URL we would know.
 
N

Neredbojias

I have a html web page with a table and sorting function in it. When
users click one of the column header of the table, it will sort the
table. Also there are some links in the table. People can click the
links to go to a new page in the same window. The problem is that the
window will never come back to the sorted status after a user hit the
back button of the browser. It come back to a default status. That is,
a unsorted table in my case.
I would like to know if there is any solution? thanks.

Yes, probably several. How are you sorting in the first place? If
javascript, you can attach a hash string to the url. I've done this
myself.
 
S

scott_us

Nerdboijas,
Yes, I used a javascript to sort in the table. Please tell me more or
give me some links to read. Thanks.
 
N

Neredbojias

Nerdboijas,
Yes, I used a javascript to sort in the table. Please tell me more or
give me some links to read. Thanks.
Scott

I ided the items sorted, read and prepped them, then did a location.replace
with the sorted order as a hash. The url looked something like this:

www.example.com#a06a14a02a01a09....

When the page first loads, it has to look for this hash-list and sort if it
exists. It's a rather complicated procedure but will work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top