Results 1 to 4 of 4
Aug 24, 2006, 11:01 #1
a way to identify the window instance
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...
Aug 24, 2006, 11:03 #2
oh, and the other solution i thought of was pass the whole query in the querystring LOL j/k.. maybe send it via post??
Aug 24, 2006, 12:15 #3
- Join Date
- Mar 2006
- 0 Post(s)
- 0 Thread(s)
you dont need to pass the actual sql into the query string, but you could pass some kind of an id which can be used to look up the data internally.
im not talking about an id for a session, im talking about an id which identifies the query/type of query etc...
Aug 24, 2006, 19:03 #4
hmm that sounds like a good idea..
I'll have to try it out.. hopefully it doesnt add too much extra work