I’m sure I’m doing something really silly, but for some reason I just can’t get the CJuiDatePicker widget to function in my view. It displays a regular textfield that accepts typed in data, or, with ‘flat’ set to true, it doesn’t appear at all. I had included a script in the widget before that just made use of the regular old jquery ui datapicker, but I would like to do it the “right” way and use CJuiDatePicker instead. I’m using Yii 1.1.7 with a theme based on jquery.mobile-jquery.mobile-1.0b1. My view looks like this:
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'person-form',
'enableAjaxValidation'=>false,
)); ?>
<?php echo $form->errorSummary($model); ?>
<!-- <div class="explainer">
Enter times in plain English, for example: <br><span>2pm September 7</span>, <span>4/11 12pm</span>, or <span>Thursday 4pm</span>
</div>-->
<?php echo $form->labelEx($model,'start'); ?>
<?php
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model'=>$model,
'name'=>'start',
// additional javascript options for the date picker plugin
'options'=>array(
'showAnim'=>'fold',
),
'htmlOptions'=>array(
'style'=>'height:20px;'
),
));
?>
<div class="row buttons" data-role="fieldcontain">
<input type="submit" name="submit" value="<?php echo $model->isNewRecord ? 'Create reservation' : 'Save'; ?>" id="submit" data-theme="b" />
</div>
<?php $this->endWidget(); ?>
</div><!-- form -->
Thanks for any help.