Yii Booster datepicker not working correctly

家住魔仙堡 提交于 2019-12-11 01:37:24

问题


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)

Any ideas?

Thanks


回答1:


@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.




回答2:


@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.




回答3:


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;}



来源:https://stackoverflow.com/questions/15081365/yii-booster-datepicker-not-working-correctly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!