Issues Cascading 2 MultiSelects

Jul 19, 2013 at 1:46 PM
Hi all,
I'm new to SPServices and was hoping to use it for a project I am working on. The scenario I am having an issue with 2 multiselect lists in a calendar view. Below is the structure of the 2 lists:

List 1:
Name: Regions
Columns: ID, University, Description, Abbv, RegionName

List 2:
Name: Systems
Columns: LongName, ID, School, Email, SiteName, RegionName

What I need to do is select 1 or many from the first multiselect based on the RegionName and populate the second with the matching sites

Below is what I have in code atm.
<script language="javascript" src="/sites/dsp/SiteAssets/jquery-1.8.3.min.js" type="text/javascript"></script>
<script language="javascript" src="/sites/dsp/SiteAssets/jquery.SPServices-2013.01.min.js" type="text/javascript"></script>

<script language="javascript" type="text/javascript">

 ExecuteOrDelayUntilScriptLoaded(loadCascadingDDL, "sp.js");

function loadCascadingDDL() 

{

 $().SPServices.SPCascadeDropdowns({

 relationshipList: "Systems",

 relationshipListParentColumn: "Region",

 relationshipListChildColumn: "RegionName",

 parentColumn: "Region",

 childColumn: "System",

 });


 

 }

</script>
I know it's probably something stupid that I'm missing so any help would be much appreciated. Thanks.

darklodus
Jul 19, 2013 at 2:03 PM
Oh and if it helps, the environment is SP 2013...

darklodus
Jul 19, 2013 at 2:09 PM
Edited Jul 19, 2013 at 2:09 PM
As a start, if you add in the lines below that I've highlighted (with "__" each side), you should get the raw response from SPServices, which will hopefully give us an idea of what is going wrong?
<script language="javascript" src="/sites/dsp/SiteAssets/jquery-1.8.3.min.js" type="text/javascript"></script>
<script language="javascript" src="/sites/dsp/SiteAssets/jquery.SPServices-2013.01.min.js" type="text/javascript"></script>

<script language="javascript" type="text/javascript">
 ExecuteOrDelayUntilScriptLoaded(loadCascadingDDL, "sp.js");

function loadCascadingDDL() 
{
 $().SPServices.SPCascadeDropdowns({
   relationshipList: "Systems",
   relationshipListParentColumn: "Region",
   relationshipListChildColumn: "RegionName",
   parentColumn: "Region",
   childColumn: "System",
 __   completefunc: function (xData, Status) {
        alert(xData.responseText);
    }__
 });
 }
</script>
Jul 19, 2013 at 2:34 PM
alibby,
Thanks for the reply, when I inserted the snip you put in there it still does nothing. I know the code impacts the multiselects because I one point in my changes so far I had the second multiselect empty and though I had it until I choose something from the first...I'll just keep cranking, it's got to be something off with the names or something from what I can tell..


darklodus
Jul 19, 2013 at 5:38 PM
No worries - it was a start: are you getting any error back, if you look at the site using something like Firebug? Or is it simply not showing anything on screen? Have you confirmed that your links to jQuery are good? It might be worth putting in an JS alert, to pipe out something like SPGetCurrentUser() - at least we can prove that the references to SP Services and jQuery are good (or bad, as the case may be...)...
Jul 19, 2013 at 6:21 PM
alibby,
I tried putting some alerts in and they aren't firing either. Kinda weird..Here's the current code, I am trying to use the example in the documentation at this point...The only thing I am doing different is using a content editor webpart for the code...
<script language="javascript" src="/sites/dsp/SiteAssets/jquery-1.8.3.min.js" type="text/javascript"></script>
<script language="javascript" src="/sites/dsp/SiteAssets/jquery.SPServices-2013.01.min.js" type="text/javascript"></script>

<script language="javascript" type="text/javascript">

// ExecuteOrDelayUntilScriptLoaded(loadCascadingDDL, "sp.js");
$(document).ready(function() {

 $().SPServices.SPCascadeDropdowns({

 relationshipList: "Systems",
 relationshipListParentColumn: "RegionFullName",
 relationshipListChildColumn: "SiteFullName",
 parentColumn: "Region",
 childColumn: "System";
 debug: true

 }

</script>
Jul 19, 2013 at 6:31 PM
Okay - it sounds like your links to jQuery and / or SPServices aren't good. Putting the code into a CEWP shouldn't be a problem though.

Can you try replacing the jQuery link with this please: http://code.jquery.com/jquery-1.8.3.min.js, and see if any alert fires for it?
Jul 19, 2013 at 6:40 PM
Here are the latest changes. Instead of using them local, I went to the remote for both js files
<script language="javascript" src="http://code.jquery.com/jquery-1.8.3.min.js" type="text/javascript"></script>
<script language="javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2013.01/jquery.SPServices-2013.01.min.js" type="text/javascript"></script>

<script language="javascript" type="text/javascript">

// ExecuteOrDelayUntilScriptLoaded(loadCascadingDDL, "sp.js");
$(document).ready(function() {

 alert(SPGetCurrentUser());

 $().SPServices.SPCascadeDropdowns({
 relationshipList: "Systems",
 relationshipListParentColumn: "RegionFullName",
 relationshipListChildColumn: "SiteFullName",
 parentColumn: "Region",
 childColumn: "System"

 }

</script>
Jul 19, 2013 at 6:45 PM
Did that produce anything in terms of an alert, error, or change in what was displayed?
Jul 19, 2013 at 6:45 PM
I'm starting to think I'm confused from all the debugging trying to get this to work LOL Correct me if I am wrong with the following:

1) relationshipList is the list we are cascading to.
2) relationshipListParentColumn is the column that both lists have that should match off of.
3) relationshipListChildColumn is the column in the list we are cascading to that should be displayed.
4) parentColumn is the column in the form we are determining the cascade with
5) childColumn is the targeted cascade.

Man I hate Fridays LOL

darklodus...
Jul 19, 2013 at 6:46 PM
alibby,
No errors with IE 10, going to check with Firebug here is a sec..

darklodus
Jul 19, 2013 at 6:59 PM
Hehe - I know the feeling...!

It looks like you've introduced another error in your recent code - try this:
<script language="javascript" src="http://code.jquery.com/jquery-1.8.3.min.js" type="text/javascript"></script>
<script language="javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/2013.01/jquery.SPServices-2013.01.min.js" type="text/javascript"></script>

<script language="javascript" type="text/javascript">
$(document).ready(function() {
   alert(SPGetCurrentUser());

   $().SPServices.SPCascadeDropdowns({
      relationshipList: "Systems",
      relationshipListParentColumn: "RegionFullName",
      relationshipListChildColumn: "SiteFullName",
      parentColumn: "Region",
      childColumn: "System"
   }); <---- missed a ); on the end here!

});  <!----- missed this too!
</script>
Jul 19, 2013 at 7:01 PM
@darklodus

This utility's setup is a little hard to grasp...
This image, produced by @bentedder in this tweet, has helped in in the past:

IMAGE - More on it here: https://twitter.com/bentedder/status/250966070347829248/photo/1


Marc:
Maybe insert a link in the documentation? I'm sure Ben would be fine with it.
(ps. off-topic: I'm liking the markdown options available here on codeplex now)

Paul.
Jul 19, 2013 at 8:29 PM
Thanks guys,
Sorry for the delay, got pulled into a meeting, for a meeting, for the meeting scenario...gotta love it. Who calls a meeting for 4:30 on a Friday? Anyhow, tried the latest code from alibby and still getting the same result. No errors, nothing.....starting to think I might need to look at this again on Monday....clear minds tend to work better :)

For now I'm gonna tweak the params some and see if anything pops. Otherwise I'm looking at it Monday....been too long for a Friday :)

darklodus....
Jul 22, 2014 at 8:55 PM
Paul,

That image represents my configuration exactly and I too am using mulit-select lookups for parent & child in the new item list. I've had success with single-select list, but can't get this multi-select configuration to work. I'm using SP2013 with SPS Services 2014.01 and jQuery 1.10.2. Nothing displays in the child list regardless of what is selected in the parent list.

Thoughts,

Gerard
Jul 22, 2014 at 10:35 PM
The image above shows the setup for single value lookups, not multi.

If your parent column is a Lookup of Multi-select, from the post I have seen here, I don t think it's going to work.

A child column can be multi-select, but not the parent.



--
Paul T.

-- Sent from Mobile

Jul 23, 2014 at 12:48 AM
ptavares wrote:
The image above shows the setup for single value lookups, not multi. If your parent column is a Lookup of Multi-select, from the post I have seen here, I don t think it's going to work. A child column can be multi-select, but not the parent. -- Paul T. -- Sent from Mobile
Paul, thanks for the prompt reply. That, however, seems contrary to the documentation for SPCascadeDropdowns. Can you clarify?

regards,

Gerard
Coordinator
Jul 23, 2014 at 8:49 AM
Any combination of multi-select, complex, or simple dropdowns ought to work.

M.
Jul 25, 2014 at 8:05 PM
sympmarc wrote:
Any combination of multi-select, complex, or simple dropdowns ought to work.

M.
Verified, Marc. I had an invalid column name for the ChildColumn - its now working. Great tool!