开发者

popup is loaded after page loads, can't wire datepicker to textbox?

I have a page that loads, and then it loads the contents for a popup using ajax.

So the problem is, when I try and wire the .datepicker() to a textbox in the popup, it doesn't seem to work and I'm guessing it is a timing issue.

The .datepicker() wiring up occurs in the ac开发者_运维百科tion/view that loads the contents of the popup.

So to summarize, the page loads, THEN it makes an ajax call to action/view to load the contents of the popup. This popup has a textbox which should fireup a datepicker when clicked.

It isn't working, is this a timing issue?


There shouldn't be any issue with putting the call to .datepicker() in the Ajax success function, after the point at which the textbox is added to the DOM. If that's not working then I don't think it's a timing issue.


I think you need to bind your datepicker() method on ajax-call


Might have something to do with the fact that some jQuery-ui functions don't work on hidden elements? eg, you've loaded the ajax, then bind it, and only then it gets displayed? (the input bot that is)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜