How to select a dynamic datepicker instance in order to extend it with jQuery

Posted by JaredC on Stack Overflow See other posts from Stack Overflow or by JaredC
Published on 2010-05-12T16:54:25Z Indexed on 2010/05/12 21:54 UTC
Read the original article Hit count: 265

Filed under:
|
|

I'm trying to control positioning of a jQuery datepicker element. I like the solution offered at http://stackoverflow.com/questions/1818670/how-to-control-positioning-of-jqueryui-datepicker for overriding the _checkOffset fn:

$.extend(window.DP_jQuery.datepicker,{_checkOffset:function(inst,offset,isFixed){return offset}});

However, this results in a 'window.DP_jQuery is undefined' error. Upon inspection, I can see that the DP_jQuery object in the DOM gets named with a random string, like so: DP_jQuery_123456. If I use this full name in the above code, it works wonderfully.

My question is whether there's a way to exend the _checkOffset fn for a datepicker instance without knowing before-hand what the instance name is? For example, can I use some sort of wildcard to select all datepicker instances that begin with 'DP_jQuery_'?

Thanks

© Stack Overflow or respective owner

Related posts about datepicker

Related posts about jquery-ui