-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPServices.SPCascadeDropdown/SPFilterDropdown - Lookup multi value #55
Comments
I don't think this will work with your data structure, and I'm not sure I understand well enough to say it will work at all. Each "cascade" is independent of the others,, but as you change a value, the change cascades down the chain. The CAMLQuery can't be dynamic; everything is set up when you make the call and doesn't change. It's possible you could clone the function(s) and adapt to get what you want to happen. If you do and feel that you have a generally useful enhancement, please post back! M. |
Ok, got it working. Might be messy but it should make it clear :) You can view the code here. So what I ended up doing was instead of checking the return value like this thisValue.indexOf(spDelim) > 0 So if I split on "#;" and get 4 values back I know there's 2 separate values (0 = ID, 1 = Value, 2 = 2nd ID, 3 = 2nd value |
Hmm was looking at the SPCascadeDropdown & it calls cascadeDropdown(parentSelect). var allParentSelections = parentSelectSelected.join(spDelim); Any chance you could explain the behaviour above? |
I was able to solve this by making a couple of changes to the function cascadeDropdown (the internal one called by SPCascadeDropdown). Would be nice if this were part of the standard SPCascadeDropdown because if the child field has multiple choices selected in the relationship list, all of them should be available in the cascaded dropdown. Here are the changes I made in the function code for Immediately after
And immediately before the ending
|
I second francois61 update for inclusion into the standard, this resolved the issue for me as well (mostly) I need it to work with matchOnId: true and right now it does not. Any chance you could update your changes to help with that Francois? Nevermind!, I just needed to set the parent column to ID instead of Title |
Glad you were able to resolve it without my help, because I am retired now, and no longer have access to a SharePoint site. :-) |
Hello,
I was wondering if I'm missing something or if it isn't possible but I'm having a problem where I want to filter based on a multi value lookup. An example below.
So I've got a list Brands with just some titles like BrandA, BrandB, BrandC.
Then I've got a list with Machines that has a lookup to brands and 1 machine can support multiple brands.
Then I've got a 3rd list: Offers which points to a machine and a brand, but I want the Offers list to filter the Machines based on the supported brands. That way if MachineA only supports BrandA, I want to see only BrandA, if MachineC supports BrandA and BrandB then I want to choose BrandA or BrandB or BrandA and BrandB. But right now I can't filter multiple values, it would only show BrandA in the dropdown. Am I doing this wrong or is it not supported to filter based on a multi value lookup?
So it would like look:
Brands
BrandA
BrandB
BrandC
Machines - Brands (Lookup to Brands)
MachineA | BrandA
MachineB | BrandB
MachineC | BrandA,BrandB
Offers - Machine - Brands (Machine lookup to machines, Brands lookup to Brands)
Offer1 | MachineC | BrandA,BranddB
jQuery/SPServices:
$().SPServices.SPCascadeDropdowns({
relationshipList: "Machines",
relationshipListParentColumn: "Title",
relationshipListChildColumn: "Brands",
parentColumn: "Machine",
childColumn: "Brands",
debug: true
});
$().SPServices.SPFilterDropdown({
relationshipList: "Machines",
relationshipListColumn: "Brands",
columnName: "Brands",
CAMLQuery: "" + machineField.GetValue() + "",
debug: true
});
Many thanks & thank you for such an awesome addition which saves me many headaches!
The text was updated successfully, but these errors were encountered: