Commit bf59a521 by Carsten Brandt

subwidgets should be rendered in the same view

parent 8473dda3
......@@ -87,6 +87,7 @@ class ButtonDropdown extends Widget
'label' => '<span class="caret"></span>',
'encodeLabel' => false,
'options' => $this->options,
'view' => $this->getView(),
]);
} else {
$label .= ' <span class="caret"></span>';
......@@ -103,6 +104,7 @@ class ButtonDropdown extends Widget
'label' => $label,
'options' => $options,
'encodeLabel' => false,
'view' => $this->getView(),
]) . "\n" . $splitButton;
}
......@@ -114,6 +116,7 @@ class ButtonDropdown extends Widget
{
$config = $this->dropdown;
$config['clientOptions'] = false;
$config['view'] = $this->getView();
return Dropdown::widget($config);
}
}
......@@ -86,7 +86,8 @@ class ButtonGroup extends Widget
$buttons[] = Button::widget([
'label' => $label,
'options' => $options,
'encodeLabel' => $this->encodeLabels
'encodeLabel' => $this->encodeLabels,
'view' => $this->getView()
]);
} else {
$buttons[] = $button;
......
......@@ -171,6 +171,7 @@ class Nav extends Widget
'items' => $items,
'encodeLabels' => $this->encodeLabels,
'clientOptions' => false,
'view' => $this->getView(),
]);
}
}
......
......@@ -134,7 +134,7 @@ class Tabs extends Widget
}
$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'])) {
$options = array_merge($this->itemOptions, ArrayHelper::getValue($item, 'options', []));
$options['id'] = ArrayHelper::getValue($options, 'id', $this->options['id'] . '-tab' . $n);
......
......@@ -193,8 +193,10 @@ abstract class BaseListView extends Widget
}
/** @var LinkPager $class */
$class = ArrayHelper::remove($this->pager, 'class', LinkPager::className());
$this->pager['pagination'] = $pagination;
return $class::widget($this->pager);
$pager = $this->pager;
$pager['pagination'] = $pagination;
$pager['view'] = $this->getView();
return $class::widget($pager);
}
/**
......@@ -209,7 +211,9 @@ abstract class BaseListView extends Widget
}
/** @var LinkSorter $class */
$class = ArrayHelper::remove($this->sorter, 'class', LinkSorter::className());
$this->sorter['sort'] = $sort;
return $class::widget($this->sorter);
$sorter = $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