Revision #3 has been created by softark on Sep 5, 2013, 11:07:20 AM with the memo:
Change about 'i18nScriptFile'
« previous (#2) next (#4) »
Changes
Title
unchanged
Using CJuiDatePicker for CGridView filter
Category
unchanged
How-tos
Yii version
unchanged
Tags
unchanged
CJuiDatePicker, CGridView, filter
Content
changed
[...]
'name' => 'due_date',
'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array(
'model'=>$model,
'attribute'=>'due_date',
'language' => 'ja',
// 'i18nScriptFile' => 'jquery.ui.datepicker-ja.js',
// (#2)
'htmlOptions' => array(
'id' => 'datepicker_for_due_date',[...]
- Call CController::widget() with the third parameter set to 'true'. (#4)
- Define 'afterAjaxUpdate' to call a javascript function that will reinstall the datepicker, because it will return to a plain textField each time the grid is updated by an ajax call. (#1) and (#5)
- I had to define language specific 'i18nScriptFile' option
manually when I first wrote this article. Setting 'language' option was not enough.
But now, you don't need to do it. (#2)
- Use 'defaultOptions' instead of 'options', otherwise you have to set those options again in the javascript function to reinstall the datepicker. (#3)
That's all. Have fun.
### More to read[...]