Nathanphan
Nathanphan

Reputation: 957

Yii Booster datepicker not working correctly

I have an issue which related to Yii booster datepicker.

scenario:

<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
'id'=>'expend-form',
'enableAjaxValidation'=>false,
'type'=>'horizontal',   )); ?>

<p class="help-block">Fields with <span class="required">*</span> are required.</p>

<?php echo $form->errorSummary($model); ?>

<?php // echo $form->textFieldRow($model,'fecha',array('class'=>'span5')); 
    echo $form->datepickerRow($model, 'fecha',
            array('prepend'=>'<i class="icon-calendar"></i>' 
                    , 'options'=>array( 'format' => 'dd/mm/yyyy', 
                                        'weekStart'=> 1,
                                        'showButtonPanel' => true,
                                        'showAnim'=>'fold',)
            )
        );

?>

Problem is:

options:

'showButtonPanel' => true,
'showAnim'=>'fold',

not working.

and the CSS have something wrong (check the screenshot)

enter image description here

Any ideas?

Thanks

Upvotes: 2

Views: 7588

Answers (3)

user2735696
user2735696

Reputation: 16

in main.css find and replace

thead th {background:e5eCf9;}

to

thead th {background:#ffffff;}

and

.box {padding:1.5em;margin-bottom:1.5em;background:#e5eCf9;}

to

.box {padding:1.5em;margin-bottom:1.5em;background:#ffffff;}

Upvotes: 0

zDaniels
zDaniels

Reputation: 600

@Nathanphan, the reason your CSS has something wrong is because the Yii css files are overriding the YiiBooster CSS. Open your main.php layout file under /protected/views/layouts and delete the following line. You may want to delete all of the CSS links.

<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" media="screen, projection" />

You should find that your YiiBooster widgets appear properly now; however some of the Yii widgets on your site may now look incorrect. You can convert your Yii widgets to equivalent YiiBooster widgets and then everything should be fine.

I've not found a way to run the Yii blueprint CSS and YiiBooster at the same time.

Upvotes: 2

Fabio Thomaz
Fabio Thomaz

Reputation: 98

@Nathanphan, you're trying to use a option from zii.widgets.jui.CJuiDatePicker in a TbDatePicker, which is based on Bootstrap Datepicker.
If you have a need to use these options (showButtonPanel and showAnim), change your code to use the CJuiDatePicker widget.

Upvotes: 0

Related Questions