SPServices.SPCascadeDropdowns - More than one seperate Parent/Child relationships on a form

Feb 1, 2013 at 11:17 AM
Hi,

Is it possible to get more than one seperate parent/child relationship on a form? I currently have the first pair working but the second pair is not filtering the child list.

Here is the setup:
1st parent - Division
1st child - Business Unit (fieldname in the child list is Title)

2nd parent - Secondary Category
2nd child - Tertiary Category (fieldname in the child list is Title)

Would you have an example of the code that would enable this if possible?

Thanks
Feb 1, 2013 at 11:34 AM
Ok... not exactly sure what I did different to my previous efforts but it is now working!

There is one thing however... the second child drop down appears with a larger drop down button and on selecting the child item I need the list remains open unless I double click the item or select it then click outside of the list.

Any ideas?
Coordinator
Feb 1, 2013 at 2:12 PM
You're seeing the difference between dropdowns with < 20 options and 20+ options. This is out of the box SharePoint behavior.

See my blog post: http://sympmarc.com/2010/05/19/two-types-of-sharepoint-forms-dropdowns/

You can convert the complex dropdown to a simple dropdown if you choose by setting simpleChild: true.

M.
Feb 1, 2013 at 2:24 PM
Hi Marc,

Thanks for that... I had a feeling it was due to the child list length.

In respect of the simpleChild: true I dont seem to have much joy with that and had attempted this earlier from your documentation.

When adding that one line to the script the result I get is that the dropdown remains with the same appearance and functionality (<20 options) but now it does not filter based on the parent list either.

Here is the script I have in place.

<script language="javascript" type="text/javascript" src=""../../jQuery%20Libraries/jquery-1.8.2.js"></script>
<script language="javascript" type="text/javascript" src=""../../jQuery%20Libraries/jquery.SPServices-0.7.2.min.js"></script>
<script language="javascript" type="text/javascript"> $(document).ready(function() { $().SPServices.SPCascadeDropdowns({ relationshipList: "Tertiary Category", relationshipListParentColumn: "Group", relationshipListChildColumn: "Title", parentColumn: "Secondary Category", childColumn: "Tertiary Category" simpleChild: true }); }); </script>
Feb 1, 2013 at 2:25 PM

<script language="javascript" type="text/javascript" src="../../jQuery%20Libraries/jquery-1.8.2.js"></script>
<script language="javascript" type="text/javascript" src=""../../jQuery%20Libraries/jquery.SPServices-0.7.2.min.js"></script>
<script language="javascript" type="text/javascript">
    $(document).ready(function() {
        $().SPServices.SPCascadeDropdowns({
            relationshipList: "Tertiary Category",
            relationshipListParentColumn: "Group",
            relationshipListChildColumn: "Title",
            parentColumn: "Secondary Category",
            childColumn: "Tertiary Category"
            simpleChild: true
        });
    });
</script>
Coordinator
Feb 1, 2013 at 2:43 PM
You're missing a comma after the childColumn line, so your code will throw and error. Darn commas.

M.
Feb 1, 2013 at 3:23 PM
Perfect!! Thanks very much!