File tree Expand file tree Collapse file tree 2 files changed +40
-1
lines changed
Ui/Component/Listing/Columns
view/adminhtml/ui_component Expand file tree Collapse file tree 2 files changed +40
-1
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Copyright © Magento, Inc. All rights reserved.
4
+ * See COPYING.txt for license details.
5
+ */
6
+ declare (strict_types=1 );
7
+
8
+ namespace Magento \Catalog \Ui \Component \Listing \Columns ;
9
+
10
+ /**
11
+ * Attribute set listing column component
12
+ */
13
+ class AttributeSetId extends \Magento \Ui \Component \Listing \Columns \Column
14
+ {
15
+ /**
16
+ * @inheritDoc
17
+ */
18
+ protected function applySorting ()
19
+ {
20
+ $ sorting = $ this ->getContext ()->getRequestParam ('sorting ' );
21
+ $ isSortable = $ this ->getData ('config/sortable ' );
22
+ if ($ isSortable !== false
23
+ && !empty ($ sorting ['field ' ])
24
+ && !empty ($ sorting ['direction ' ])
25
+ && $ sorting ['field ' ] === $ this ->getName ()
26
+ ) {
27
+ $ collection = $ this ->getContext ()->getDataProvider ()->getCollection ();
28
+ $ collection ->joinField (
29
+ 'attribute_set ' ,
30
+ 'eav_attribute_set ' ,
31
+ 'attribute_set_name ' ,
32
+ 'attribute_set_id=attribute_set_id ' ,
33
+ null ,
34
+ 'left '
35
+ );
36
+ $ collection ->getSelect ()->order ('attribute_set_name ' . $ sorting ['direction ' ]);
37
+ }
38
+ }
39
+ }
Original file line number Diff line number Diff line change 144
144
<label translate =" true" >Type</label >
145
145
</settings >
146
146
</column >
147
- <column name =" attribute_set_id" component =" Magento_Ui/js/grid/columns/select" sortOrder =" 50" >
147
+ <column name =" attribute_set_id" class = " Magento\Catalog\Ui\Component\Listing\Columns\AttributeSetId " component =" Magento_Ui/js/grid/columns/select" sortOrder =" 50" >
148
148
<settings >
149
149
<options class =" Magento\Catalog\Model\Product\AttributeSet\Options" />
150
150
<filter >select</filter >
You can’t perform that action at this time.
0 commit comments