gridview + ajax + renderpartial + datepicker = not working

Hi,

I’m struggling with a common ajax problem;

Scenario is like this:

I have a CJuitab which uses renderpartial to generate a gridviews in each tab;

each gridview has a button which opens a cjuidialog window;

the contents of this window is generated by an ajax call tied to the button above.

In the window of the dialog I want a datepicker.

My main problem is, that I have to put the datepicker OUTSIDE of the ajax generated content in order for it to work;

How can I integrate the datepicker inside the ajax function so it will show up and function normally.

I’ve tried several ways: put a renderpartial inside the ajax to generate the datepicker: datepicker shows up, but the localized language reverts to something asian (japanese, korean, or similar), while I initialize it as ‘Dutch’. Putting it directly inside the ajaxfunction doesn’t work either; the input field shows, but the datepicker is not triggered at all when clicking on the field.

Any ideas how to call a jui datepicker widget from inside an ajaxcall?

I’m encountering the same issue. :(

Try using an iframe in the CJuiDialog rather than a div. Following the notes in this wiki…

CGridView: Update/create records in a CJuiDialog

… I was able to implement fully jQuery and Ajax functionality (including AutoComplete and DatePicker functionality) in the dialog, while also being able to update the grid views outside the dialog.

watch this…! whatever this use this…




<?php echo $form->labelEx($model,'dob'); ?>

            <?php  

            $this->widget('zii.widgets.jui.CJuiDatePicker', array(

            'model' => $model,

            'attribute' => 'dob',

            'options'=>array(

                'dateFormat' => 'dd/mm/yy',                

                'showAnim'=>'fold',

                'changeMonth'=>'true', 

                'changeYear'=>'true',

            ),

            'htmlOptions' => array(

                    'size' => '10',         // textField size

                    'maxlength' => '10',    // textField maxlength

            ),

            ));

            ?>

            <?php echo $form->error($model,'dob'); ?>