Cascading Dropdown Problems

Apr 30, 2012 at 8:25 PM

I have one cascading dropdown list working already. This one won't work, the second column only displays "none".

I have a relationship list "policyType" with Title and Department columns. Department is a lookup column pointed at another list "Departments". I do not get any errors and don't know where to look next.

Here's my code:

<script type="text/javascript" language="javascript" src="/spfiles/jquery-1.6.4.js">
</script><script type="text/javascript" language="javascript" src="/spfiles/jquery.SPServices-0.7.1a.min.js"></script>
<script type="text/javascript" language="javascript">
    $(document).ready(function() {
        $().SPServices.SPCascadeDropdowns({
        relationshipList: "{2DD2C59B-D14B2-D426B-DB031-D4F0C95116C5E}",
        relationshipListParentColumn: "Department",
        relationshipListChildColumn: "Title",
        parentColumn: "Department",
        childColumn: "Policy Type",
        debug: true
    });
});
</script>

 

Coordinator
Apr 30, 2012 at 8:47 PM

Michael:

It's hard to say without seeing the data. Since you have debug set to true, you should see a message if any of the column names aren't right. BTW, you can use the list name rather than the GUID if it's easier.

M.

Apr 30, 2012 at 9:07 PM
Edited May 1, 2012 at 4:42 PM

Hello, Thank you so much for the response. It is much appreciated. I tried using the relationshipLIst Name and adding the relationshipshipWebURL. Still no dice.

<script type="text/javascript" language="javascript" src="/spfiles/jquery-1.6.4.js">
</script><script type="text/javascript" language="javascript" src="/spfiles/jquery.SPServices-0.7.1a.min.js"></script>
<script type="text/javascript" language="javascript">
    $(document).ready(function() {
        $().SPServices.SPCascadeDropdowns({
        relationshipWebURL: "/Lists/policyType/",
        relationshipList: "policyType",
        relationshipListParentColumn: "Department",
        relationshipListChildColumn: "Title",
        parentColumn: "Department",
        childColumn: "Policy Type",
        listName: "policyType",
        debug: true
    });
});
</script>

1. I have one list "Departments" with department names.

2. The relationship list is called "policyType". The "Title" field is the name of the policy and the "Department" field is a lookup on the first "Departments" list.

3. The "Department" Column in the doc library is a lookup to the "Departments" list.

4. The Policy Type, child column, in the doc library is a lookup to the "policyType" list.

The only difference between this library and the library that is working is that this one is in a subsite. The relationshiplist is on the main site. That's why I used the GUID at first. I have made sure I am using the right GUID, the right column names and it's still not workig.

 

Thanks again for your help Marc.

May 1, 2012 at 10:42 PM

I blew the library and content type away because I thought it might have to do with the fact that I created columns in the library and then added the content type with the same name columns.

Now when I select the parent dropdown it does clear the child but there aren't any options. There aren't any spaces in the column names, which threw me off last time, and I am not getting any debug errors.

May 2, 2012 at 4:36 PM
Edited May 2, 2012 at 4:37 PM

I got it to work. I don't know why the GUID wasn't working. I changed to the list name and corrected the web url. The final, working, code looks like this.

 

 <script type="text/javascript" language="javascript" src="/spfiles/jquery-1.6.4.js">
</script><script type="text/javascript" language="javascript" src="/spfiles/jquery.SPServices-0.7.1a.min.js"></script>
<script type="text/javascript" language="javascript">
    $(document).ready(function() {
		$().SPServices.SPCascadeDropdowns({
			relationshipWebURL: "/",
			relationshipList: "policyType",
			relationshipListParentColumn: "Department",
			relationshipListChildColumn: "Title",
			parentColumn: "Department",
			childColumn: "Policy Type",
			debug: true
		});
});
</script>

Thank you for providing spservices Marc. Good day.
Coordinator
May 3, 2012 at 3:01 AM

Hey, you got it working and that's the important part.

M.