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:
/Paul
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