Cascading on checkbox field

May 13, 2011 at 8:32 PM

Hi,

First, thanks a ton for this wonderful library. It has been really helpful in our sites.

I have a new requirement to populate the child column(dropdown) based on the values selected in a checkbox field. So far, I haven't found any solution for that.

My question is, is it possible to do cascading on a checkbox field ? Thanks.

- Lavanya

 

Coordinator
May 13, 2011 at 10:04 PM
Lavanya:

I'm glad you find SPServices useful!

I don't have anything right now which would work with checkboxes. That said, it's an interesting enhancement idea. Could you explain more about what you want to do? The more specific, the better.

M.
>
May 16, 2011 at 5:01 PM

Thanks for the prompt reply.

The reason for check box is to select multiple items in the parent column and populate the child column based on it.

I know the multi-valued look up columns work with SPServices. That is, I can select multiple values in a multi-valued look up parent column and the child column gets populated based on this. I am looking for the same functionality, but for a check box.

Also, I just don't know how to thank you for the wonderful CAMLQuery option in the SPCascadeDropdowns. I was able to give multiple filtering on my child column. This makes it easy for the end users to select the correct values, especially when the end users are not very tech-savy. I work for a govt. School Board and the end-users are elementaty and secondary school teachers.

The SPDisplayRelatedInfo function is also vey useful and everyone just loves it here.

Please see an example of how I have used the CAMLQuery option. You can see that I am dynamically picking the values(the values selected by the user when they are filling out the form).

$().SPServices.SPCascadeDropdowns({
   relationshipList: "Programs",
   relationshipListParentColumn: "Length",
   relationshipListChildColumn: "Title",
   parentColumn: "Length",
   childColumn: "Select_Program",
                        CAMLQuery: "<And><And><Eq><FieldRef Name='Field_x0020_Centres'/><Value Type='Text'>" + FCLookupVal + "</Value></Eq><Eq><FieldRef Name='Level' /><Value Type='Text'>" + LevelVal + "</Value></Eq></And><Eq><FieldRef Name='Season' /><Value Type='Text'>" + SeasonVal + "</Value></Eq></And>",
                        debug: true
});

Thanks.

-Lavanya.

Coordinator
May 17, 2011 at 3:09 AM

Lavanya:

I could see this checkbox idea being useful, for sure. I'm going to add it to the Issue Tracker so that I don't lose the idea. In the meantime, does using a multi-select "dropdown" work for you or is this a showstopper?

I'm so glad that you've found SPServices so useful! That's certainly why I wrote the darn thing in the first place: to make SharePoint work better.

I'm curious when you are calling SPCascadeDropdown as you show above. Since you're passing variables into the CAMLQuery, are you doing the call on $(document).ready() or at some later point? I'm always trying to understand how people are using things in real world situations so that I can layer in useful enhancements.

M.

Coordinator
May 17, 2011 at 3:10 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.