Skip to content

Commit

Permalink
Fixed $htmlOptions['id']
Browse files Browse the repository at this point in the history
  • Loading branch information
Maciej authored and Maciej committed Mar 31, 2015
1 parent 28b843d commit 8f0842a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ public function init() {
* @inheritdoc
*/
public function run() {
$this->registerClientScript();

$output = '';
if ($this->selector === null) {
$htmlOptions = ArrayHelper::merge([
$this->htmlOptions = ArrayHelper::merge([
'id' => $this->getId()
], $this->htmlOptions);

Html::addCssClass($htmlOptions, 'gtreetable');
Html::addCssClass($htmlOptions, 'table');
Html::addCssClass($this->htmlOptions, 'gtreetable');
Html::addCssClass($this->htmlOptions, 'table');

$output = Html::beginTag('table', $htmlOptions);
$output = Html::beginTag('table', $this->htmlOptions);
$output .= Html::beginTag('thead');
$output .= Html::beginTag('tr');
$output .= Html::beginTag('th', array('width' => '100%'));
Expand All @@ -56,9 +56,9 @@ public function run() {
$output .= Html::endTag('tr');
$output .= Html::endTag('thead');
$output .= Html::endTag('table');

return $output;
}
$this->registerClientScript();
return $output;
}

/**
Expand All @@ -72,7 +72,7 @@ public function registerClientScript() {
$assetBundle->language = $this->options['language'];
}

$selector = $this->selector === null ? '#' . (array_key_exists('id', $this->htmlOptions) ? $this->htmlOptions['id'] : $this->getId()) : $this->selector;
$selector = $this->selector === null ? '#' . $this->htmlOptions['id'] : $this->selector;
$options = Json::encode($this->options);

$view->registerJs("jQuery('$selector').gtreetable($options);");
Expand Down

0 comments on commit 8f0842a

Please sign in to comment.