This might be a bit difficult to explain but I'll try to be as clear as possible.
I have a page that lists appointments that need to be confirmed. A user will open this page and click on the first appointment in the list. This will take them to another page where the details of the appointment are located. On this second page the user will update fields and submit the form, marking it as confirmed. If the user could not contact the person who the appointment is with, then they will click a button to designate the reason, no-answer, phone disconnected, etc... In either case the db table is updated and the user is redirected back to the list of appointments. This is where my question comes in.
If the user confirmed the appointment, when the list page reloads, that appointment will no longer be listed, so if we confirmed every appointment, they would always be working on the first record and all would be well. Since they don't confirm every appointment, they start working their way down the list. The list usually contains approximately 800 appointments. What I would like to do is when the user is redirected back to the list page that they will have the next record already highlighted for them and have it scroll into view. Where I have a problem is determining which row of the table they need to be directed to as well as how this will translate into a scroll position.
To make this a bit more difficult, the table can be sorted by any of the columns, which is done by storing the sort field and ascending or descending in hidden form fields in a form that posts back to the same page and submiting that form. If the user does re-sort the table, then they will go to the top record of the table. I have no problem with this, but when they come back to the list from confirming (or failing to confirm) an appointment, then I would want the sort order to be the same as when they went to the appointment detail page.
At this point I don't have any code to handle all of this, it simply redirects back to the list page after the user confirms an appointment and they lose their sort order and position.
My current thoughts on the matter are to add hidden form fields for the sort order and direction and the row number into the detail page, so when the detail page is submitted it will have that information which can then be submitted via form values back to the original list page. This should give me most of what I want. I'll be able to get the sort order and direction right, but I'm still not sure how to scroll down to the appropriate row in the table.
Any thoughts on getting the scroll position, or other ideas on how to handle this situation would be appreciated.