SPCascadeDropdowns and promptText

Dec 6, 2011 at 9:55 AM

Hi All,

I'm using the Dropdown code, which I find very useful, but now I have a little issue:

I've put the code 

		promptText: "ALL",

And when I try to save my list with this value in some of my fields, I get:

Value is not among the set of valid lookup values.

But I've added ALL as child for all the parent list.

Configuration: JQuery 1.6.1 and SPServices 0.6.2

Where could be the problem?


Thanks for your help!

Coordinator
Dec 6, 2011 at 11:10 AM
The promptText option is something I put in an early version of SPServices and realized was a bad idea, as I note in the docs. I left it in for backward compatibility but I discourage using it.

If you want to have the ALL option at the top of the dropdown, add it to your relationshipList (as you have) but don't use promptText. If you want to ensure that it is the first choice, then add a column to the relationshipList which you can sort on.

M.
Dec 6, 2011 at 2:19 PM
sympmarc wrote:
The promptText option is something I put in an early version of SPServices and realized was a bad idea, as I note in the docs. I left it in for backward compatibility but I discourage using it.

If you want to have the ALL option at the top of the dropdown, add it to your relationshipList (as you have) but don't use promptText. If you want to ensure that it is the first choice, then add a column to the relationshipList which you can sort on.

M.

Hi Marc,

Thanks for the answer. With your option, will I be able to have "ALL" filled, lile prompt text?

Example:

Continent
Country
City

For example, I'll just choose a continent, then for Country and City, I want to have the automatic option of having ALL by default, without having to open the drop down menu.

Is that possible?

Thanks! 

Coordinator
Dec 6, 2011 at 2:29 PM

If you want the user to be able to select all of the options, then you should probably make it a multiselect column. They could then move all of the items from the left box to the right. If you want to give them an "ALL" button or something, you'll need to build that functionality.

M.

Dec 6, 2011 at 2:29 PM

What would you put in the column that you recommend, because if I put 1, 2, 3,... If I order them, it won't work above 10, as it will see 10 as being before 2.

Dec 6, 2011 at 2:30 PM
sympmarc wrote:

If you want the user to be able to select all of the options, then you should probably make it a multiselect column. They could then move all of the items from the left box to the right. If you want to give them an "ALL" button or something, you'll need to build that functionality.

M.

That is why the promptText was useful. It was kind of the button you are speaking about :)

Coordinator
Dec 6, 2011 at 2:46 PM

Except that selecting ALL wouldn't actually select all of the values; it would select the value "ALL".

M.

Dec 6, 2011 at 3:02 PM
Edited Dec 6, 2011 at 4:24 PM
sympmarc wrote:

Except that selecting ALL wouldn't actually select all of the values; it would select the value "ALL".

M.

I know, it's just a way for the user to know everything was selected, and I'll do calculation in the background (import in Excel).

If I have:

Continent: Europe (from a list and mandatory)
Country: ALL (show up by default, and not mandatory)
City: ALL (show up by default and not mandatory)

A kind of selectSingleOption but with the possibility to select the first one in the row.

By the way, I manged to get my list to be sorted correctly.