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

New Post: Issue filtering with CascadeDropdowns

$
0
0
Mm; typo -- unfortunately didn't work.
CAMLquery: dquery, 
It just doesn't do a thing; it's like it doesn't understand -- which makes no sense to me.

I can sit here and change the department drop down 100 times; pull variable deptnm from firebug and it changes. Even look at dquery and it updates the string with the right "text" I need.

Something doesn't seem right--why can I hardcode
"<Eq><FieldRef Name='Departments'/><Value Type='Text'>Access</Value></Eq>"
And it works; but yet try to use variables so it's dynamic and it doesn't.

Correct code:
<script language="javascript" type="text/javascript">
var deptnm
var dquery
$(document).ready(function() {
$().SPServices.SPCascadeDropdowns({
relationshipList: "pillars",
relationshipListParentColumn: "Department",
relationshipListChildColumn: "Title",
parentColumn: "Department",
childColumn: "Pillar",
completefunc: function() {
deptnm = $("select[title='Department'] option:selected").text()
dquery = "<Eq><FieldRef Name='Departments'/><Value Type='Text'>" + deptnm + "</Value></Eq>"
},
debug: true
});
$().SPServices.SPCascadeDropdowns({
relationshipList: "measures",
relationshipListParentColumn: "Pillar",
relationshipListChildColumn: "Title",
CAMLQuery: dquery,
parentColumn: "Pillar",
childColumn: "Measure"
});
});
</script>

Viewing all articles
Browse latest Browse all 6517

Trending Articles



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