Good morning.
I have the following in one admin view:
<?php $this->widget('application.components.GridView', array(
'id'=>'tv-entradas-grid',
'dataProvider'=>$modelEntradas->search(),
'filter'=>$modelEntradas,
'afterAjaxUpdate' => 'reinstallDatePicker',
'selectableRows'=>1,
'columns'=>array(
array(
'name' => 'Data',
'value'=>'Yii::app()->dateFormatter->format("dd/MM/yyyy","$data->Data")',
'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model'=>$modelEntradas,
'attribute'=>'Data',
'language' => 'es',
'i18nScriptFile' => 'jquery.ui.datepicker-es.js', )
'htmlOptions' => array(
'id' => 'data_entradas',
'size' => '10',
),
'defaultOptions' => array(
'dateFormat' => 'dd/mm/yy',
'showButtonPanel' => true,
)
),
true), // (#4)
),
...
...
...
Yii::app()->clientScript->registerScript('re-install-date-picker', "
function reinstallDatePicker(id, data)
{
$.datepicker.setDefaults($.datepicker.regional['es']);
$('#data_entradas').datepicker({'dateFormat': 'dd/mm/yy'}); ");
And it works fine. Language is setting to Spanish.
But if I copy this code in another admin view, it isn’t work!!!!!!
Language is setting to English.
Anyone can help me?
Regards.