Difference between #2 and #3 of
Using CJuiDatePicker for CGridView filter

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
[...]
19 0
31 followers
Viewed: 64 458 times
Version: 1.1
Category: How-tos
Written by: softark
Last updated by: Kostas Apazidis (KonApaz)
Created on: Mar 26, 2012
Last updated: 10 years ago
Update Article

Revisions

View all history