Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: Issue filtering with CascadeDropdowns

$
0
0
First off; this works -- to an extent. I just need help figuring out what I am missing.

I have (3) drop downs;
  • Department
  • Pillar
  • Measure
The issue I have is trying to get the measure drop down to show the appropriate entries based on the department. Pillar works; if I have 5 different values for a certain department is shows, if I have 3, it shows.

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?

Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>