This repository was archived by the owner on Apr 29, 2019. It is now read-only.
File tree 4 files changed +45
-4
lines changed
Sales/view/adminhtml/ui_component
4 files changed +45
-4
lines changed Original file line number Diff line number Diff line change 35
35
<listingToolbar name =" listing_top" >
36
36
<bookmark name =" bookmarks" />
37
37
<columnsControls name =" columns_controls" />
38
- <exportButton name =" export_button" />
38
+ <exportButton name =" export_button" >
39
+ <settings >
40
+ <additionalParams >
41
+ <param xsi : type =" string" active =" true" name =" order_id" >*</param >
42
+ </additionalParams >
43
+ </settings >
44
+ </exportButton >
39
45
<filterSearch name =" fulltext" />
40
46
<filters name =" listing_filters" >
41
47
<filterSelect name =" store_id" provider =" ${ $.parentName }" >
Original file line number Diff line number Diff line change 35
35
<listingToolbar name =" listing_top" >
36
36
<bookmark name =" bookmarks" />
37
37
<columnsControls name =" columns_controls" />
38
- <exportButton name =" export_button" />
38
+ <exportButton name =" export_button" >
39
+ <settings >
40
+ <additionalParams >
41
+ <param xsi : type =" string" active =" true" name =" order_id" >*</param >
42
+ </additionalParams >
43
+ </settings >
44
+ </exportButton >
39
45
<filterSearch name =" fulltext" />
40
46
<filters name =" listing_filters" >
41
47
<filterSelect name =" store_id" provider =" ${ $.parentName }" >
Original file line number Diff line number Diff line change 35
35
<listingToolbar name =" listing_top" >
36
36
<bookmark name =" bookmarks" />
37
37
<columnsControls name =" columns_controls" />
38
- <exportButton name =" export_button" />
38
+ <exportButton name =" export_button" >
39
+ <settings >
40
+ <additionalParams >
41
+ <param xsi : type =" string" active =" true" name =" order_id" >*</param >
42
+ </additionalParams >
43
+ </settings >
44
+ </exportButton >
39
45
<filterSearch name =" fulltext" />
40
46
<filters name =" listing_filters" >
41
47
<filterSelect name =" store_id" provider =" ${ $.parentName }" >
Original file line number Diff line number Diff line change @@ -54,16 +54,39 @@ public function getComponentName()
54
54
*/
55
55
public function prepare ()
56
56
{
57
+ $ context = $ this ->getContext ();
57
58
$ config = $ this ->getData ('config ' );
58
59
if (isset ($ config ['options ' ])) {
59
60
$ options = [];
60
61
foreach ($ config ['options ' ] as $ option ) {
61
- $ option ['url ' ] = $ this ->urlBuilder ->getUrl ($ option ['url ' ]);
62
+ $ additionalParams = $ this ->getAdditionalParams ($ config , $ context );
63
+ $ option ['url ' ] = $ this ->urlBuilder ->getUrl ($ option ['url ' ], $ additionalParams );
62
64
$ options [] = $ option ;
63
65
}
64
66
$ config ['options ' ] = $ options ;
65
67
$ this ->setData ('config ' , $ config );
66
68
}
67
69
parent ::prepare ();
68
70
}
71
+
72
+ /**
73
+ * Get export button additional parameters
74
+ *
75
+ * @param array $config
76
+ * @param ContextInterface $context
77
+ * @return array
78
+ */
79
+ protected function getAdditionalParams ($ config , $ context )
80
+ {
81
+ $ additionalParams = [];
82
+ if (isset ($ config ['additionalParams ' ])) {
83
+ foreach ($ config ['additionalParams ' ] as $ paramName => $ paramValue ) {
84
+ if ('* ' == $ paramValue ) {
85
+ $ paramValue = $ context ->getRequestParam ($ paramName );
86
+ }
87
+ $ additionalParams [$ paramName ] = $ paramValue ;
88
+ }
89
+ }
90
+ return $ additionalParams ;
91
+ }
69
92
}
You can’t perform that action at this time.
0 commit comments