I am doing some new forms for an application. Until now i used the ZendX_JQuery_Form_Element_DatePicker in non-ajax requests.
No i have one problem with rendering correctly ZendX_JQuery_Form_Element_DatePicker withind a subform from an ajax request.
The situation is:
1. JQuery and jQuery UI are initialized from controller (or from view)
$this->view->jQuery()->enable()->uiEnable();
and the js libraries are loaded, actually this code added to the view
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"></script>
2. The subform is rendered correctly
3. Problem is no code for initalizing the DatePicker is rendered, as:
<script type="text/javascript"> //<![CDATA[ $(document).ready(function() { $("#test-1-start_date").datepicker({"showOn":"both","showStatus":"true","buttonImage":"\/admin\/library\/jqueryui\/media\/calendar.gif","buttonImageOnly":"true","dateFormat":"yy-mm-dd","changeMonth":"true","changeYear":"true"}); ); //]]> </script>
Yes, i know adding the $(document).ready(function() { doesn't makes much sense from ajax, but anyway, i can't find any explanation why the DatePicker initialization code is not rendered also, just the libraries and form code...
-- Best regards, Cristian Bichis www.zftutorials.com | www.zfforums.com | www.zftalk.com | www.zflinks.com
没有评论:
发表评论