|
12 | 12 | */
|
13 | 13 | class Grid extends \Magento\Backend\Block\Widget\Grid
|
14 | 14 | {
|
15 |
| - /** |
16 |
| - * @var \Magento\Framework\View\Element\UiComponentFactory |
17 |
| - */ |
18 |
| - protected $componentFactory; |
19 |
| - |
20 |
| - /** |
21 |
| - * @param \Magento\Backend\Block\Template\Context $context |
22 |
| - * @param \Magento\Backend\Helper\Data $backendHelper |
23 |
| - * @param \Magento\Framework\View\Element\UiComponentFactory $componentFactory |
24 |
| - * @param array $data |
25 |
| - */ |
26 |
| - public function __construct( |
27 |
| - \Magento\Backend\Block\Template\Context $context, |
28 |
| - \Magento\Backend\Helper\Data $backendHelper, |
29 |
| - \Magento\Framework\View\Element\UiComponentFactory $componentFactory, |
30 |
| - array $data = [] |
31 |
| - ) { |
32 |
| - $this->componentFactory = $componentFactory; |
33 |
| - parent::__construct($context, $backendHelper, $data); |
34 |
| - } |
35 |
| - |
36 |
| - /** |
37 |
| - * @return $this |
38 |
| - * @throws \Magento\Framework\Exception\LocalizedException |
39 |
| - */ |
40 |
| - protected function _prepareCollection() |
41 |
| - { |
42 |
| - $component = $this->componentFactory->create('sales_order_grid'); |
43 |
| - $this->prepareComponent($component); |
44 |
| - $component->render(); |
45 |
| - $collection = $component->getContext()->getDataProvider()->getCollection(); |
46 |
| - $this->setData('dataSource', $collection); |
47 |
| - |
48 |
| - return parent::_prepareCollection(); |
49 |
| - } |
50 |
| - |
51 |
| - /** |
52 |
| - * @param \Magento\Framework\View\Element\UiComponentInterface $componentElement |
53 |
| - * @return void |
54 |
| - */ |
55 |
| - protected function prepareComponent(\Magento\Framework\View\Element\UiComponentInterface $componentElement) |
56 |
| - { |
57 |
| - foreach ($componentElement->getChildComponents() as $childComponent) { |
58 |
| - $this->prepareComponent($childComponent); |
59 |
| - } |
60 |
| - $componentElement->prepare(); |
61 |
| - } |
62 | 15 | }
|
0 commit comments