Any Ideas on Implementing a Simple Product Selector?
For example, when managing cross sells, I envision a text area where you can optionally enter product IDs or SKUs, but a link next to it titled "product selector". Clicking on the link would pop open a window with some kind of filter search and paginated product list. You'd check a check box next to the products you wanted and then hit the "add selected" button at the bottom of the page that would add the selected IDs or SKUs to the value of the text area. I don't love the idea of a text area although it has the benefits of allowing for manual entry and being simple - maybe another approach would be a multiple select with values being added based on either entries into a text box or on those selected using the pop-up.
I guess what I'm wondering is if anyone has seen a good example of a fairly slick such system that could be generalized and generated for the generic case where you need to use a pop up to select n-elements of an object and return titles and values to some kind of underlying page with a select box. I'm a complete JS n00b, so I'm really trying to find to find a slick sample that I could dissect, generalize and use as a custom data type to solve this class of display problems. The stuff I really don't get is how to handle things like passing the values from one window to another and I'm not absolutely sure about the visual interface either. Anyone seen a slick solution to this class of problem?



I have done things like that. I have never quite been satisfied with it (but it doesn't come up often enough for me to make time to improve). The way I handle it is that I open up a pop-up window and, as part of the URL query string, pass in a Javascript function name. This function name will act as my "handler" for whatever data I am passing back (usually some sort of delimited list or array). It does a decent job, but again, never been 100% happy with it.
If no one else chimes in, I can whip something up at lunch to demo what I am talking about.
Would love to have a look at that! Know what you mean about never enough cases to improve it - that is really why I haven't got into this problem before, but I'm now going through everything I do trying to improve the components I'm going to be reusing. If I do find anything better I'll certainly let you know/contribute it back!
You're probably right. It wasn't the kind of thing I saw off the bat with JQuery but I know it is something I should be checking out. Was just looking for a quicker fix!
http://interface.eyecon.ro/docs/autocomplete
jQuery is gentle to those new at javascript, if you follow the provided examples.
FYI - Dan Switzer (qForms) has a nice Autocomplete example here:
http://www.pengoworks.com/workshop/jquery/autocomp...
I know some has since taken Dan's code and is further refining it but I don't think it's stable (yet).
Try this: http://www.bennadel.com/index.cfm?dax=blog:672.vie...