gridview + ajax + renderpartial + datepicker = not working
Posted 24 January 2012 - 07:38 PM
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?
Posted 21 February 2012 - 03:47 AM
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.
Posted 16 March 2013 - 06:20 AM
<?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'); ?>