<?php
$this->widget('zii.widgets.jui.CJuiDatePicker',array(
'model'=>$model,
'attribute'=>'s_time',
'language'=>'zh_cn',
'name'=>'visit_time',
'value'=> Date('Y-m-d'),
'options'=>array(
'showAnim'=>'fold',
'showOn'=>'both',
'buttonImage'=>Yii::app()->->request->baseUrl .'/static/images/times.png',
'maxDate'=>'new Date()',
//'minDate'=>'new Date()',
'changeMonth'=>true,
'changeYear'=>true,
'buttonImageOnly'=>true,
'dateFormat'=>'yy-mm-dd'
),
'htmlOptions'=>array(
'size' => 10,
'style'=>'height:18px,line-height:15px',
'maxlength'=>20
)
));
?>
model:控制器传到视图里的对象模型
attribute:该对象的属性
options:主要是日历控件显示相关的
showAnim:日历框出现的动画效果,可选值
showOn:日历框如何被触发,both:点图标和输入框均可;focus:点输入框;button:点图标
buttonImage:图标图片地址
maxDate:可选的最大日期
minData: 可选的最小日期
dateFormat:日历数据格式。注意,上面value的日期格式必须与此处一致,否则数据不会与控件匹配
htmlOptions:input框的一些html设置,如样式,最大长度等

被折叠的 条评论
为什么被折叠?



