Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: Possible bug in SPComplexToSimpleDropdown

$
0
0
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 namefunction 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 dropdownif (opt.simpleChild === true&& childSelect.Type === dropdownType.complex) {
            $().SPServices.SPComplexToSimpleDropdown({
                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 idvar 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.
M.

Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>