Could someone please help me out with something which is really frustrating me:
With the code below the datepicker popup refuses to appear. In Firebug I noticed that the css and js files for the datepicker are not being included.
I have used "dateFieldControlGroup" and then, as shown in a post in the forums here, I used "customActiveControlGroup", but for neither does the popup appear.
Below the "customActiveControlGroup" there is a portion of code commented out. When I do include this bit of code, then the popup appears, and I notice in Firebug that the relevant WhDateTimePicker js and css is included…
Otherwise, yiistrap and yiiwheels is rendering fine in other forms that I have, so I assume it is not a configuration error.
Here is the code of the form:
<?php
/* @var $this MemberController */
/* @var $model Member */
/* @var $form TbActiveForm */
?>
<div class="form">
<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm', array(
'id'=>'member-form',
// Please note: When you enable ajax validation, make sure the corresponding
// controller action is handling ajax validation correctly.
// There is a call to performAjaxValidation() commented in generated controller code.
// See class documentation of CActiveForm for details on this.
'enableAjaxValidation'=>false,
//'layout'=>'horizontal',
)); ?>
<p class="help-block">Fields with <span class="required">*</span> are required.</p>
<?php echo $form->errorSummary($model); ?>
<?php echo $form->textFieldControlGroup($model,'Name',array('span'=>5,'maxlength'=>64)); ?>
<?php echo $form->textFieldControlGroup($model,'Surname',array('span'=>5,'maxlength'=>64)); ?>
<?php echo $form->emailFieldControlGroup($model,'Email',array('span'=>5)); ?>
<?php echo $form->textFieldControlGroup($model,'Phone',array('span'=>3)); ?>
<?php echo $form->dateFieldControlGroup($model,'FromDate',array('span'=>2)); ?>
<?php //echo $form->dateFieldControlGroup($model,'ToDate',array('span'=>2)); ?>
<?php $datePicker = $this->widget('yiiwheels.widgets.datetimepicker.WhDateTimePicker', array(
'model' => $model,
'attribute' => 'ToDate',
'pluginOptions' => array(
'format' => 'dd.mm.yyyy',
'language' => 'uk',
),
), true); ?>
<?php echo TbHtml::customActiveControlGroup($datePicker, $model, 'ToDate'); ?>
<?php /*
<div class="control-group ">
<label class="control-label" for="Member_ToDate">To</label>
<div class="controls">
<?php
$this->widget('yiiwheels.widgets.datepicker.WhDatePicker',
array(
'model' => $model,
'attribute' => 'ToDate',
'pluginOptions' => array(
'format' => 'yyyy-mm-dd'
)
)
);
?>
</div>
</div>
*/?>
<div class="form-actions">
<?php echo TbHtml::submitButton($model->isNewRecord ? 'Create' : 'Save',array(
'color'=>TbHtml::BUTTON_COLOR_PRIMARY,
'size'=>TbHtml::BUTTON_SIZE_LARGE,
)); ?>
</div>
<?php $this->endWidget(); ?>
</div><!-- form -->