Project Description

SPCascade lets you create multi-level cascaded dropdown lists on SharePoint forms using single line JQuery code. Only ONE SharePoint list is used as a source for storing all your look up columns.


How To Deploy:

1. Download required files using above "Download" link.
2. Create a source sharepoint list to store all look up columns hierarchy.
3. Create a destination sharepoint list where you want to use cascaded dropdowns.
4. Link required javascript files in NewForm.aspx and EditForm.aspx files of your list.
5. Insert javascript code to initiate spCascade dropdowns.

 

Syntax

var spObjName = $().SPCascade({
	destListColTitles: [<Destination List Column Titles array>], 

srcListColInternalNames: [<Source List internal Column Names array>],

srcListName: '<Source List Name>',

srcListFilterCAMLQuery: "<Query><Where>...
Source List Filter Query..</Where></Query>"


spWebURL: 'http://sharepointurl',

getDataOnly: '<true or false>',

debug: '<true or false>',

});



//Purple fields are not mandatory
Additional Functionality: (Added in v1.1.0)

1. Get Complete List Data: 
spObjName.getData();
=> Returns List Data Array in following format:
[{srcColName1:"srcColValue1",srcColName2:"srcColValue2"},
{srcColName1:"srcColValue1",srcColName2:"srcColValue21"}...]

2. Get Choices using single column filter: 
spObjName.getChoices(srcColName, srcColValue, returnValuesOfCol);
=> Returns filteres values in following format:
["Value1","Value2","Value3"..]

3. Get Sub Choices using multiple column filters: 
spObjName.getSubChoices(srcColNames, srcColValues, returnValuesOfCol);
=> Returns filtered values in following format:
["Value1","Value2","Value3"..]

4. Reset Dropdowns back to text input types: 
spObjName.resetFields();
 

 Example

var spObj = $().SPCascade({
	destListColTitles: ['Continent','Country','State','City'], 
	srcListColInternalNames: ['Continent','Country','State','Title'],
	srcListName: 'CitiesLookupList',
	srcListFilterCAMLQuery: "<Query><Where><Contains>
	<FieldRef Name='Continent'/><Value Type='Text'>America</Value>
	</Contains></Where></Query>"
	spWebURL: 'http://sharepointurl',
	getDataOnly: 'false',
	debug: 'true',
});
Additional Functionality: (Added in v1.1.0)

1. Get Complete List Data: 
spObj.getData();
=> 
[{"Continent:"North America",Country:"USA", 
State:"Washington", Title:"Seattle"},
{Continent:"North America",Country:"USA",
State:"Washington", Title:"Kirkland"}...]

2. Get Choices using single column filter: 
spObj.getChoices("Country", "USA", "Title");
=> Returns filteres values in following format:
["Seattle","Kirkland","Redmond"..]

3. Get Sub Choices using multiple column filters: 
spObj.getSubChoices(["Continent","Country"],
 ["North America","USA"], "Title");
=> Returns filtered values in following format:
["Seattle","Kirkland","Redmond"..]

4. Reset Dropdowns back to text input types: 
spObjName.resetFields();
 

 For more details and Tutorial visit SPCascade homepage

http://www.spcascade.org

 

Last edited Jan 27 at 12:37 PM by mandorg, version 7