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

New Post: Office 365 update changes 'Display Name' on required fields- breaks cascades

$
0
0
I also like this idea... It would make the utilities more robust and allow for more use cases... The challenge will be to determine if the input param is a jQuery selector or a DOM Element -vs- a column Title.

You are already dependent on jQuery, so anything passed in by the input param could be given to jQuery as a selector and it would handle it... jQuery accepts many types of selection types - including DOM elements...

The following could work:
var $ele = null;

// Is it a string? could be title or jQuery selector
if (typeof opt.childColumn === "string") {

    // Is it a column title?
    $ele = $("input[Title='" + opt.childColumn + "']");

    // If not, is it a jQuery Selector string?
    if (!$ele.length) {

        $ele = $(opt.childColumn);

    }

// Else: not a string... must be an object which include DOM elements or jQuery selection objects.
} else {

    $ele = $(opt.childColumn);

}

// $ele should point to an element by this point.
This would handle setting the the childColumn as a Column title, jQuery selector string, jQuery Object and DOM element.

/Paul

Viewing all articles
Browse latest Browse all 6517

Trending Articles



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