CodeIgniter Forums
Best way to pick related Data / associate records together - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Best way to pick related Data / associate records together (/thread-31163.html)



Best way to pick related Data / associate records together - El Forum - 06-08-2010

[eluser]packetfox[/eluser]
Hello there,

say for example i have a product, and need to provide a way for a user to pick one (or more) Vendors from a List in order to associate them together.

Technically, its simple enough: If i only associate one vendor to a product, i add a vendorID field to the products table; If i associate more than one vendor to a product, i use an extra table to hold productID's and vendorID's together.

My Question is more about usability and aesthetics: How to provide an easy way to linkup vendors to products?

1. Using a HTML Selectbox, so when viewing a product i can choose from a list of Vendors. Now this is neat, but when the List of Vendors grows to 500 Entries or more, its really not so neat anymore.

2. Using Jquery-UI's new Autocomplete, so when i start typing a Vendor ID or a Vendor Name my Dropdown List automatically shows matching results. This currently seems to be the best way i can think of; but usually id prefer less JS rather than more.

Does anyone have any other good ideas how to associate records to each other as in my described scenario?

Many thanks and best regards,
D


Best way to pick related Data / associate records together - El Forum - 06-09-2010

[eluser]steelaz[/eluser]
I would go with jQuery Autocomplete, but if you try to do less JavaScript, you could add a button or a link that opens pop-up window with vendor list table and checkbox next to each vendor.