Commit bf59a521 by Carsten Brandt

subwidgets should be rendered in the same view

parent 8473dda3
...@@ -87,6 +87,7 @@ class ButtonDropdown extends Widget ...@@ -87,6 +87,7 @@ class ButtonDropdown extends Widget
'label' => '<span class="caret"></span>', 'label' => '<span class="caret"></span>',
'encodeLabel' => false, 'encodeLabel' => false,
'options' => $this->options, 'options' => $this->options,
'view' => $this->getView(),
]); ]);
} else { } else {
$label .= ' <span class="caret"></span>'; $label .= ' <span class="caret"></span>';
...@@ -103,6 +104,7 @@ class ButtonDropdown extends Widget ...@@ -103,6 +104,7 @@ class ButtonDropdown extends Widget
'label' => $label, 'label' => $label,
'options' => $options, 'options' => $options,
'encodeLabel' => false, 'encodeLabel' => false,
'view' => $this->getView(),
]) . "\n" . $splitButton; ]) . "\n" . $splitButton;
} }
...@@ -114,6 +116,7 @@ class ButtonDropdown extends Widget ...@@ -114,6 +116,7 @@ class ButtonDropdown extends Widget
{ {
$config = $this->dropdown; $config = $this->dropdown;
$config['clientOptions'] = false; $config['clientOptions'] = false;
$config['view'] = $this->getView();
return Dropdown::widget($config); return Dropdown::widget($config);
} }
} }
...@@ -86,7 +86,8 @@ class ButtonGroup extends Widget ...@@ -86,7 +86,8 @@ class ButtonGroup extends Widget
$buttons[] = Button::widget([ $buttons[] = Button::widget([
'label' => $label, 'label' => $label,
'options' => $options, 'options' => $options,
'encodeLabel' => $this->encodeLabels 'encodeLabel' => $this->encodeLabels,
'view' => $this->getView()
]); ]);
} else { } else {
$buttons[] = $button; $buttons[] = $button;
......
...@@ -171,6 +171,7 @@ class Nav extends Widget ...@@ -171,6 +171,7 @@ class Nav extends Widget
'items' => $items, 'items' => $items,
'encodeLabels' => $this->encodeLabels, 'encodeLabels' => $this->encodeLabels,
'clientOptions' => false, 'clientOptions' => false,
'view' => $this->getView(),
]); ]);
} }
} }
......
...@@ -134,7 +134,7 @@ class Tabs extends Widget ...@@ -134,7 +134,7 @@ class Tabs extends Widget
} }
$header = Html::a($label, "#", ['class' => 'dropdown-toggle', 'data-toggle' => 'dropdown']) . "\n" $header = Html::a($label, "#", ['class' => 'dropdown-toggle', 'data-toggle' => 'dropdown']) . "\n"
. Dropdown::widget(['items' => $item['items'], 'clientOptions' => false]); . Dropdown::widget(['items' => $item['items'], 'clientOptions' => false, 'view' => $this->getView()]);
} elseif (isset($item['content'])) { } elseif (isset($item['content'])) {
$options = array_merge($this->itemOptions, ArrayHelper::getValue($item, 'options', [])); $options = array_merge($this->itemOptions, ArrayHelper::getValue($item, 'options', []));
$options['id'] = ArrayHelper::getValue($options, 'id', $this->options['id'] . '-tab' . $n); $options['id'] = ArrayHelper::getValue($options, 'id', $this->options['id'] . '-tab' . $n);
......
...@@ -193,8 +193,10 @@ abstract class BaseListView extends Widget ...@@ -193,8 +193,10 @@ abstract class BaseListView extends Widget
} }
/** @var LinkPager $class */ /** @var LinkPager $class */
$class = ArrayHelper::remove($this->pager, 'class', LinkPager::className()); $class = ArrayHelper::remove($this->pager, 'class', LinkPager::className());
$this->pager['pagination'] = $pagination; $pager = $this->pager;
return $class::widget($this->pager); $pager['pagination'] = $pagination;
$pager['view'] = $this->getView();
return $class::widget($pager);
} }
/** /**
...@@ -209,7 +211,9 @@ abstract class BaseListView extends Widget ...@@ -209,7 +211,9 @@ abstract class BaseListView extends Widget
} }
/** @var LinkSorter $class */ /** @var LinkSorter $class */
$class = ArrayHelper::remove($this->sorter, 'class', LinkSorter::className()); $class = ArrayHelper::remove($this->sorter, 'class', LinkSorter::className());
$this->sorter['sort'] = $sort; $sorter = $this->sorter;
return $class::widget($this->sorter); $sorter['sort'] = $sort;
$sorter['view'] = $this->getView();
return $class::widget($sorter);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment