SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Guru mwolfe's Avatar
    Join Date
    Mar 2005
    Posts
    912
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    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...

    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?

  2. #2
    SitePoint Guru mwolfe's Avatar
    Join Date
    Mar 2005
    Posts
    912
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oh, and the other solution i thought of was pass the whole query in the querystring LOL j/k.. maybe send it via post??

  3. #3
    SitePoint Wizard silver trophy
    Join Date
    Mar 2006
    Posts
    6,132
    Mentioned
    0 Post(s)
    Tagged
    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...

  4. #4
    SitePoint Guru mwolfe's Avatar
    Join Date
    Mar 2005
    Posts
    912
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm that sounds like a good idea..
    I'll have to try it out.. hopefully it doesnt add too much extra work


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •