This project has moved. For the latest updates, please go here.


Possible bug in SPComplexToSimpleDropdown



I see what you are saying. genContainerId isn't respecting the listName that you've passed in. BUG!

I think this will fix it:
    // Generate a unique id for a containing div using the function name and the column display name
    function genContainerId(funcname, columnName, listName) {
        var l = listName !== undefined ? listName : $().SPServices.SPListNameFromUrl();
        return funcname + "_" + $().SPServices.SPGetStaticFromDisplay({
            listName: l,
            columnDisplayName: columnName
    } // End of function genContainerId
and changing the call to SPComplexToSimpleDropdown like this:
        // If requested and the childColumn is a complex dropdown, convert to a simple dropdown
        if (opt.simpleChild === true && childSelect.Type === dropdownType.complex) {
                listName: opt.listName,
                columnName: opt.childColumn
and then picking up the listName in SPComplexToSimpleDropdown:
    // function to convert complex dropdowns to simple dropdowns
    $.fn.SPServices.SPComplexToSimpleDropdown = function(options) {

        var opt = $.extend({}, {
            listName: $().SPServices.SPListNameFromUrl(), // The list the form is working with. This is useful if the form is not in the list context.
            columnName: "", // The display name of the column in the form
            completefunc: null, // Function to call on completion of rendering the change.
            debug: false // If true, show error messages;if false, run silent
        }, options);


        // Build up the simple dropdown, giving it an easy to select id
        var simpleSelectId = genContainerId("SPComplexToSimpleDropdown", opt.columnName, opt.listName);
While I'm at it, I'm adding listName as an option to SPComplexToSimpleDropdown, SPDisplayRelatedInfo, SPFilterDropdown, SPAutocomplete, and SPSetMultiSelectSizes.
Closed Dec 16, 2014 at 6:34 PM by sympmarc
Fixed/deployed in 2014.02


sympmarc wrote Jun 24, 2014 at 7:57 PM

Fixed in 2014.01ALPHA1