Ginger
Posts: 1
|
| Posted: 06/09/2005, 8:10 AM |
|
Hi Everyone,
Firstly, I confess I'm a newbie to CCS, ASP and SQL, so please bear with me.
But I've been crawling the forums and CCS examples of how to do dependent list boxes. Everything I've seen involves a one-to-many relationship within the database where the dependent field is directly in the table being filtered. But how can I set up the Data Source for the list box to handle a many-to-many relationship?
For example in my case I have dependent listboxes of departments and research areas. Because of all the overlap and collaboration, the database really has to have a many-to-many relationship. So naturally there is a table for departments, a table for research, and a relational table between them. For our page, we want it that when you select a department, you can see what research areas pertain to that department. I honestly have no idea how to get CCS to work through the relational table to pull the results from the research table. Any advice? 
Thanks in advance!
-Ginger
|
 |
 |
peterr
Posts: 5971
|
| Posted: 06/09/2005, 11:56 AM |
|
I think that your case is not much different then using one-to-many relations, or maybe even easier to implement. If you look at our dependent listboxes example at http://examples.codecharge.com/CCSExamplePack2/Dependen...dentListBox.php you will see the HTML includes an array of relations between the pairs of listbox items:
var Product = new Array(
new Array(21,3,'1001 Web Site Tips and Tricks'),
new Array(18,1,'Beginning Active Server Pages 3.0'),
new Array(10,2,'Beginning ASP Databases'),
And this is done by placing a grid on that page that displays those array values, like:
<!-- BEGIN Grid store_products1 -->
var Product = new Array(
<!-- BEGIN Row -->
new Array({product_id},{category_id},'{product_name}')<!-- END Row --><!-- BEGIN Separator -->,<!-- END Separator -->
);
<!-- END Grid store_products1 -->
So all you need to do is to create a grid that outputs the values from your table that defines relations between the 2 other tables. All steps of recreating that example should work for you.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
|