First off; this works -- to an extent. I just need help figuring out what I am missing.
I have (3) drop downs;
Here is my code; using latest SPServices and jQuery releases.
It seems like this string;
I have (3) drop downs;
- Department
- Pillar
-
Measure
Here is my code; using latest SPServices and jQuery releases.
$(document).ready(function() {
$().SPServices.SPCascadeDropdowns({
relationshipList: "pillars",
relationshipListParentColumn: "Department",
relationshipListChildColumn: "Title",
parentColumn: "Department",
childColumn: "Pillar",
debug: true
});
$().SPServices.SPCascadeDropdowns({
relationshipList: "measures",
relationshipListParentColumn: "Pillar",
relationshipListChildColumn: "Title",
relationshipListSortColumn: "ID",
CAMLQuery: "<Eq><FieldRef Name='Departments'/><Value Type='Text'>" + $("select[title='Department'] option:selected").text() + "</Value></Eq>",
parentColumn: "Pillar",
childColumn: "Measure"
});
});
</script>
The one thing I have noticed is that if I run "$("select[title='Department'] option:selected").text()" and I have a department selected--it returns that department. If I replace this code with "Access" (name of department); Measure filters appropriately.It seems like this string;
CAMLQuery: "<Eq><FieldRef Name='Departments'/><Value Type='Text'>" + $("select[title='Department'] option:selected").text() + "</Value></Eq>",
Will not work against whatever I have selected in Departments. I'm wondering if maybe I have it in the wrong place in my code?