this isnt totally php related, but i am a bit confused how to tackle a problem i have..
I wrote a class that generates a datagrid using a query, and a whole bunch of fancy additions for what can be done. One of the things i do is allow a column to be a link that can add querystring details so that it can reference its form element.. say i have a table of pc's and the first column is the pc_name.. well you can click on that pc_name and then get the form for editing that pc.
Now in the edit form, i made a scroller so you can go back and forward..
unfortuantely, this scroller (back forward links) sorts pc pc_name which is unique. This makes sense, but the datagrid can be sorted by another column, such as model.. it would be nice for the scroller to then go through the pc's by model isntead of by pc_name..
It took a lot of thinking for me to figure out how to accomplish this.. but the way i see it is to store the query i'm using in a session variable, and retrieve that in the form, and use that to scroll 1 item at a time much the same way typical pagination occurs.. but what if the user opened 2 windows in the same browser, with the same data grid, one sorted on pc_model, and one sorted on pc_serial.
whichever was clicked last would end up being the sort order for both forms... this isnt a huge deal but could be a problem...
is there any way around his sort of problem with sessions?? If somehow i could identify an instance.. maybe using javascript.. then i could use that in the session name and make each different so i don't reference the same session in 2 different windows. any ideas?
Bookmarks