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

filterdropdown question

Jan 22, 2015 at 11:12 PM
hi, great library :)

when using the filterdropdown, function, how would you pass a value from the form into the camlquery section?

so instead of this
CAMLQuery: "<Eq><FieldRef Name='ContactStatus' /><Value Type='Text'>Active</Value></Eq>",

I could have
CAMLQuery: "<Eq><FieldRef Name='ContactStatus' /><Value Type='Text'> <Value of selected status> </Value></Eq>",

where the value is set on the same edit page ?

Jan 23, 2015 at 1:43 PM
That will depend on the type of control you are using for your query value. For instance, if the control is a simple <input> element with a display name of "Contract Status", something like this will work:
"<Eq><FieldRef Name='ContactStatus' /><Value Type='Text'>" + $("input[name='Contract Status']").val() + "</Value></Eq>",
Marked as answer by justfeckincode on 1/23/2015 at 7:45 AM
Jan 23, 2015 at 3:45 PM
thanks for that,

on further reading of the documentation, it seems that the SPCascadeDropdowns function may actually be a better fir for my needs, as i see that you can also include the CAMLQuery option to further filter the drop down - i', going to play around with that and see if it works for me.
Jan 23, 2015 at 8:42 PM
if the control is rendered as a select - how would you expected to grab the selected value?
and is that value available in the document ready function

because if i have this


i get this

function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(a))},null,a,arguments.length)}

which i cannot use in the CAMLOptions!

Jan 26, 2015 at 10:02 PM
You may be working too hard. If you want cascading, then SPCascadeDropdowns does it all for you.

With both SPCascadeDropdowns and SPFilterDropdowns, the CAMLQuery will only be applied when the function is first called; you cannot call it subsequently.

Jan 28, 2015 at 7:37 PM
for future sharepoint 2013 uses 'title' instead of 'name'