Flo*_*ent 10 yii yii-events yii-components yii-extensions yii1.x
我在Yii框架的JQRelcopy模块中遇到了CJuiDatePicker的问题.
我使用这个模块,因为我有一个带有datepicker字段的表单,可以根据用户的意愿复制多次.
如果我放一个普通字段(没有datepicker),模块工作正常,但是一旦我添加了模块CJuiDatePicker,它也是Yii框架的一个模块,我就会出现一个空白页面.我按照以下教程:http://www.yiiframework.com/extension/jqrelcopy/解释了包含CJuiDatePickerm的表单中的集成jqrelcopy,这正是我需要的.
我研究了这个问题,我发现当我在我的小部件JQRelcopy的属性中使用以下行时,会出现问题:
'jsAfterNewId'=> JQRelcopy :: afterNewIdDatePicker($ datePickerConfig),
在
$ this-> widget('ext.jqrelcopy.JQRelcopy',array(
Run Code Online (Sandbox Code Playgroud)'id' => 'copylink', 'removeText' => 'remove', //add the datapicker functionality to the cloned datepicker with the same options 'jsAfterNewId' => JQRelcopy::afterNewIdDatePicker($datePickerConfig),));
我看了几个论坛,一个人遇到了和我一样的问题.
你能帮助我吗?
对不起我的英语不好
过去我能做到这一点的唯一方法是放弃 CJuiDatePicker 并使用JQuery 的on方法。
$('body').on('focus', '.idata', function(){
jQuery(this).datepicker(
jQuery.extend(
{showMonthAfterYear:false},
jQuery.datepicker.regional['pt-BR'],
{'showAnim':'fold','dateFormat':'dd/mm/yy'}
)
);
});
Run Code Online (Sandbox Code Playgroud)
或者,您可以使用实时方法...