Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Yii Framework 2 jui extension Change Log
2.0.8 under development
-----------------------

- no changes in this release.
- Bug #87: Inline display does not allow using altField option (buttflattery)


2.0.7 November 25, 2017
Expand Down
12 changes: 12 additions & 0 deletions src/DatePicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use yii\helpers\FormatConverter;
use yii\helpers\Html;
use yii\helpers\Json;
use yii\helpers\ArrayHelper;

/**
* DatePicker renders a `datepicker` jQuery UI widget.
Expand Down Expand Up @@ -199,7 +200,18 @@ protected function renderWidget()
$contents[] = Html::hiddenInput($this->name, $value, $options);
}
$this->clientOptions['defaultDate'] = $value;

//check for user defined value for option altField
$customAltField = ArrayHelper::getValue($this->clientOptions, 'altField', false);

//add the default field selector
$this->clientOptions['altField'] = '#' . $this->options['id'];

//add any custom field selector if specified
if ($customAltField) {
$this->clientOptions['altField'] .= ', ' . $customAltField;
}

$contents[] = Html::tag('div', null, $this->containerOptions);
}

Expand Down