How add CJuiDatePicker in JQRelcopy on Yii Framework
Asked Answered
D

2

10

I have a problem with CJuiDatePicker in the module JQRelcopy on Yii framework.

I use this module as I have a form with a datepicker field to be copied as many times as the user wishes.

The module works fine if I put a normal field (without datepicker), but as soon as I add the module CJuiDatePicker which is also a module of the Yii framework, I have a blank page appears. I followed the following tutorial: http://www.yiiframework.com/extension/jqrelcopy/ explains the integration jqrelcopy in a form containing CJuiDatePickerm, which is exactly what I need.

I study the problem and I saw that it was when I Atoute the following line in the properties of my widget JQRelcopy the problem occurs:

'jsAfterNewId' => JQRelcopy::afterNewIdDatePicker($datePickerConfig),

in

$this->widget('ext.jqrelcopy.JQRelcopy', array(

  'id' => 'copylink',
  'removeText' => 'remove',

  //add the datapicker functionality to the cloned datepicker with the same options
  'jsAfterNewId' => JQRelcopy::afterNewIdDatePicker($datePickerConfig),

));

I look in several forums and anywhere a person has had the same problem as me.

Devious answered 29/11, 2012 at 13:50 Comment(6)
Do you not get any error messages? In the console?Refractory
No, i haven't got error messages. I just have got a blank page !Devious
And in firebug/console (google chrome CTRL + SHIFT + J)?Refractory
I have got this : <html> <head></head> <body></body> </html> so I think it must be a PHP errorDevious
Did you try to do that out of your project ? In a brain new clean project where only that piece of code is running. Maybe it is a conflict with another functionality.Complaisance
Yes, I've tried but I have the same problem.Devious
T
0

The only way I could do this in the past, was ditching the CJuiDatePicker and using the on method of JQuery.

$('body').on('focus', '.idata', function(){
        jQuery(this).datepicker(
            jQuery.extend(
                {showMonthAfterYear:false},
                jQuery.datepicker.regional['pt-BR'],
                {'showAnim':'fold','dateFormat':'dd/mm/yy'}
            )
        );
    });

Or, you can use live method...

Tawnytawnya answered 8/1, 2013 at 22:35 Comment(0)
S
0

Just Import ext.jqrelcopy.JQRelcopy in your form file at the top

Yii::import('ext.jqrelcopy.JQRelcopy'); 

Your Problem be solved if any Issue let me know i will further assist.

Seismography answered 30/6, 2014 at 9:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.