Cjuidatepicker - Set Once

Hi,

Is there a way to specify how you want ALL datepickers to appear, and then call that setup on each instance, so that it all looks the same on every form - and more importantly when one is changed, they all are…

I call every date picker like this (and I’m getting RSI from cutting and pasting ha), also, is it possible to put a space between the input and icon? minor irritation.




<?php $this->widget('zii.widgets.jui.CJuiDatePicker', array(

  'model' => $model,

  'attribute' => 'adviser_callback_follow_up',

  'htmlOptions' => array('size'=>60,'maxlength'=>128,),

  'options'=>array(

    'showAnim'=>'fold',

    'showOn'=>'both', 

    'buttonImage'=>'images/ico_calendar.gif',

    'buttonImageOnly'=>'true',

    'dateFormat'=>'dd/mm/yy',

  ),

)) ?>



Of course it’s possible => Customizing Widgets Globally

Ha I love replies that start with "Of course…", it makes me happy!

Thanks, will take a look.

#update# That works sweetly @kokomo!

I did however, just spend the last couple of hours chasing a "property not defined" error (after adding a few columns to the DB), MVC all updated, but still this dam error…

FINALLY I realise that because I changed main.php by adding the code below, I FORGOT to change the name of the database, and just uploaded to the dev machine, so I was working away on the DEV server, but the DB was looking at the PRODUCTION server - hence the error because the new tables dont exist on production yet!

OMG moment.

Thanks for your help! although it cost me alt of time and coffee, its worth it haha

Paul.




'widgetFactory'=>array(

  'widgets'=>array(

    'CJuiDatePicker'=>array(

      'language'=>'en',

      'htmlOptions' => array('size'=>60,'maxlength'=>128,),

        'options'=>array(

          'showAnim'=>'fold',

          'showOn'=>'both', 

          'buttonImage'=>'images/ico_calendar.gif',

          'buttonImageOnly'=>'true',

          'dateFormat'=>'dd/mm/yy',

        ),

     ),

  ),

),