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

Deactivate SPCascadeDropdowns

Mar 22, 2013 at 10:04 AM
I can activate SPCascadeDropdowns on some event (document.ready fo example).
Is there any way to deactivate SPCascadeDropdowns feature by some condition?

Thank you.
Mar 22, 2013 at 12:33 PM
No, I never built a "turn off" option into the function. I can't recall anyone ever asking for it.

Can you explain what you are trying to do?

Mar 22, 2013 at 2:42 PM
I have a scenario, in it child list depend on two factors, user can choose the factor.
For example:
Product has fixed variants of size and weight
User can select to choose products by size or weight.
Parameters are presented on form by 2 select controls.
I am hiding one of these selects, and want to filter products by selected option in visible select.
That’s why I need to turn off one call of SPCascadeDropdowns and activate another one.
Mar 22, 2013 at 6:00 PM
What about not calling either instance of SPCascadeDropdowns until you know which one you need? You could even hide the child column until the size/weight value has been selected.

Mar 22, 2013 at 7:02 PM
I don't think that will work.
If the user made mistake, he could not change his decision without reopening page.
Mar 22, 2013 at 7:04 PM
That's a fair point, but it would work for the normal course of things.

Mar 23, 2013 at 8:22 AM
Thank you, for response.
In the end, I have used another solution that work in my private case.
But I still think that have an opportunity to turn off any feature will be great in general.
Mar 25, 2013 at 3:25 PM
If you namespace the event handlers, it'll be real easy to turn them off on the fly:

Might be cool to autogenerate the namespace and return that at the end of the function or something like that. Doing that, it may be easier to turn off the exact events that you want and not everything SPServices provides.

Mar 25, 2013 at 3:47 PM
Yeah, it's probably not a horribly hard thing to do, but I just haven't implemented it. I'll add it to the Issuer Tracker. (I hate that it's called an Issue Tracker - this is just an enhancement!)

Mar 25, 2013 at 3:50 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Mar 25, 2013 at 4:42 PM
Going to upvote this one... I like the idea @RuslanDayanov has.