1

I'm new to SharePoint dev and i've implemented SPServices Cascaded dropdown using Jquery.

I managed to get it to work in a subsite of the top level site collection, without problems. But the problem is that i've got some lists and a lib on the top level site collection and i want to implement the Cascaded dropdown there also. And that won't work, i've checked if the scripts are fully loaded with following code;

<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
<script language="javascript" src="//sharepoint/Style%20Library/jquery-1.10.2.min.js"></script>
<script language="javascript" src="//sharepoint/Style%20Library/jquery.SPServices-2013.01.min.js"></script>
<script language="javascript" >

$(document).ready(function() {

alert("jquery");
alert($().SPServices.SPGetCurrentSite());
});
</script>

And indeed, it gives me the two pop-ups, so there's no problem.

But when i render the following code;

<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
<script language="javascript" src="">http://sharepoint/SPServices/jquery-1.10.2.min.js</script>
<script language="javascript" src="">http://sharepoint/SPServices/jquery.SPServices-2013.01.min.js</script>
<script language="javascript" >

$(document).ready(function() {
$().SPServices.SPCascadeDropdowns({
relationshipList: "lookupCountry",
relationshipListParentColumn: "Region",
relationshipListChildColumn: "Title",
parentColumn: "Region",
childColumn: "Country",
debug: true
});

});
</script>

Nothing happens...not even an error.

I've checked the blog of Marc D Anderson, and read the documentation of the SPServices and so many others, but without success.

Could anyone help me please?

2 Answers 2

1
$().SPServices.SPCascadeDropdowns({
  relationshipWebURL: "",
  relationshipList: "",
  relationshipListParentColumn: "",
  relationshipListChildColumn: "",
  relationshipListSortColumn: "",
  parentColumn: "",
  childColumn: "",
  CAMLQuery: "",
  CAMLQueryOptions: "<QueryOptions><IncludeMandatoryColumns>FALSE</IncludeMandatoryColumns></QueryOptions>", // Added in 2013.01
  listName: $().SPServices.SPListNameFromUrl(), 
  promptText: "",
  simpleChild: false,           // Added in v0.6.2
  selectSingleOption: false,        // Added in v0.6.2
  matchOnId: false,         // Added in v0.7.1
  completefunc: null,
  debug: false
});

You should use the relationshipWebURL parameter, if the relation is not on the current web site.

relationshipWebURL The URL of the Web (site) which contains the relationshipList. If not specified, the current site is used. Examples would be: "/", "/Accounting", "/Departments/HR", etc. Note: It's always best to use relative URLs.

0

There's a bug in 2013.01 when used in the root site of the Web App. Try 0.7.2 for now. I've got a new release (2013.02) coming soon with the fix.

[Update]

You can also continue to use 2013.01 but pass in the webURL for the root site even though it is the current site, e.g.,

relationshipWebURL: "/"

[/Update]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.