This project has moved and is read-only. For the latest updates, please go here.

Forth Level Selection issues - SPCascadeDropdowns

Dec 10, 2012 at 12:44 PM

Please please help me!! I absolutely love the SPService set of jQuery tools but I'm really struggling the Cascading drop downs. I've managed to get it working normally and it does so under normal circumstances where it's a linear flow, however, I have a slightly more complex scenario.... I have 4 lists, City -> Property -> Room Type -> Room

Everything works perfectly up to the room point. Because multiple properties have the different room types then the list of rooms is just bringing me back rooms for the different properties and not the one selected.

I've tried to use CAML query but I just can't seem to get this to work 

If there's anyone that has done something similar or can help me it would be greatly appreciated. 

The code I have so far is:

$(document).ready(function() {
relationshipList: "Property",
relationshipListParentColumn: "Title",
relationshipListChildColumn: "Property",
parentColumn: "City",
childColumn: "Property",
relationshipList: "RoomType",
relationshipListParentColumn: "Property",
relationshipListChildColumn: "RoomType",
relationshipListSortColumn: "ID",
parentColumn: "Property",
childColumn: "RoomType"
relationshipList: "Room",
relationshipListParentColumn: "RoomType",
relationshipListChildColumn: "BedSpace",
relationshipListSortColumn: "ID",
parentColumn: "RoomType",
childColumn: "Room"

Dec 10, 2012 at 2:25 PM


By default - as I originally implemented the SPCascadeDropdowns function - the matching is done using the text values. In v0.7.1, I added an option called matchOnId, which does pretty much what you'd expect. Rather than matching based on the text value, it matches on the ID of the parent item. I think using that option ought to fix your issue.

Keep in mind, however that to an end user, two values with the same text are the same value; they can't see any difference. It may present other issues down the road which you should consider.


Dec 10, 2012 at 2:38 PM

Thanks for the reply, I'm not sure if that will help, I uploaded the data in 4 separate lists as I took the data from an SQL export and I'm just looking up against that.


If I was to try as you suggested, how would I go about that?





Dec 10, 2012 at 2:39 PM


I think it will. It switches the mathing from the text values to the ID of each value in the SharePoint lists.


Dec 10, 2012 at 6:13 PM

No, unfortunately not. The problem is that I've done it quite a 'dirty' way.

I took an export from the SQL data base and then created the separate lists and just copied and pasted the data into the lists. (Hands up, I'm not a programmer and I know there's better ways to do this!)

So I have City, that has an ID and the City name.

Property that has the City name and the Property

RoomType that has City, Property and RoomType

Finally Room that has: City, Property, RoomType and BedSpace (along with a host of other information)

Does this make sense? Hence why I was trying to use the CAML query so that it used the cascading list to get the room type but then the CAML query to filter the property too leaving me with just the rooms in that Property for the selected room type.





Dec 10, 2012 at 8:27 PM


Ok, you have different problems, then.

One issue is that you're not pointing to the right column is the code. In each list, the unique key is the Title column. That's the childColumn in each case.

Also, you only want to maintain one relationship per list. Take a look at the Country/Region/State example in the docs.


Jan 18, 2013 at 4:45 PM


 I've used SPServices successfully for a couple of projects. One recent struggle I'm hoping you can help with is similar (if not the same) as Phil's.

Example: Cascading Lookups for columns A through D. Column D's lookup needs to not only be based on the selection in column C, but that of A, B and C. 

Is this the same issue where I should be using the ID as the key?


I appreciate any assistance. Thanks, Jack

Jan 18, 2013 at 4:48 PM


SpCascadeDropdowns can only do a one-to-one relationship. If you can come up with a way for that to work by structuring your data differently, then great. Otherwise, you'll need to customize something for yourself.