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

SPCascadeDropdowns Custom forms

Jul 9, 2010 at 3:09 PM


Is SPCascadeDropdowns designed to only work on the default forms?

I have the primary function of filtering the child dropdown working correctly but the promptText value does not appear.  (intranet application with a mixed userbase of IE6/IE8).  I'm using stable base 0.5.6




Jul 9, 2010 at 3:10 PM

I believe I see the problem but let me know if I'm over looking things.



I believe the problem arises with the dependency on listNameFromUrl calls.  The returned value is undefined causing browser specific behaviors.


	// Get the current list's GUID (ID) from the current URL.  Use of this function only makes sense if we're in a list's context,
	// and we assume that we are calling it from an aspx page which is a form or view for the list.


Possible solution (thoughts):

Add another option to the SPCascadeDropdown function call.

		var opt = $.extend({}, {
			relationshipWebURL: "",				// [Optional] The name of the Web (site) which contains the relationships list
			relationshipList: "",				// The name of the list which contains the parent/child relationships
			relationshipListParentColumn: "",	// The internal name of the parent column in the relationship list
			relationshipListChildColumn: "",	// The internal name of the child column in the relationship list
			relationshipListSortColumn: "",		// [Optional] If specified, sort the options in the dropdown by this column,
								// otherwise the options are sorted by relationshipListChildColumn
			listname: listNameFromUrl(),
			parentColumn: "",					// The display name of the parent column in the form
			childColumn: "",					// The display name of the child column in the form
			CAMLQuery: "",						// [Optional] For power users, this CAML fragment will be Anded with the default query on the relatedList
			promptText: "Choose {0}...",		// [Optional] Text to use as prompt. If included, {0} will be replaced with the value of childColumn
			completefunc: null,					// Function to call on completion of rendering the change.
			debug: false						// If true, show error messages; if false, run silent
		}, options);

Then replace all underlying calls to listNameFromUrl() to opt.listname.  This would provide 2 benefits:  Reduce the number of "GetListCollection" calls allow SPCascadeDropdowns to be more flexible.



Jul 10, 2010 at 10:58 PM


You may be onto something here. Is the form in question not withing the list context? e.g., do you have it in the root of the site or something?

In any case, I think your suggestion makes good sense. I'll add it into the next alpha.


Jul 10, 2010 at 10:59 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.