@@ -4,7 +4,7 @@ import { IControlsTestProps, IControlsTestState } from './IControlsTestProps';
4
4
import { escape } from '@microsoft/sp-lodash-subset' ;
5
5
import { FileTypeIcon , IconType , ApplicationType , ImageSize } from '../../../FileTypeIcon' ;
6
6
import { Dropdown , IDropdownOption } from 'office-ui-fabric-react/lib/components/Dropdown' ;
7
- import { PrimaryButton } from 'office-ui-fabric-react/lib/components/Button' ;
7
+ import { PrimaryButton , DefaultButton } from 'office-ui-fabric-react/lib/components/Button' ;
8
8
import { DialogType } from 'office-ui-fabric-react/lib/components/Dialog' ;
9
9
import { Placeholder } from '../../../Placeholder' ;
10
10
import { ListView , IViewField , SelectionMode , GroupOrder , IGrouping } from '../../../ListView' ;
@@ -28,7 +28,8 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
28
28
this . state = {
29
29
imgSize : ImageSize . small ,
30
30
items : [ ] ,
31
- iFrameDialogOpened : false
31
+ iFrameDialogOpened : false ,
32
+ initialValues : [ ]
32
33
} ;
33
34
34
35
this . _onIconSizeChange = this . _onIconSizeChange . bind ( this ) ;
@@ -78,8 +79,11 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
78
79
* Method that retrieves the selected terms from the taxonomy picker
79
80
* @param terms
80
81
*/
81
- private _onTaxPickerChange ( terms : IPickerTerms ) {
82
- console . log ( "Terms:" , terms ) ;
82
+ private _onTaxPickerChange = ( terms : IPickerTerms ) => {
83
+ this . setState ( {
84
+ initialValues : terms
85
+ } ) ;
86
+ console . log ( "Terms:" , terms ) ;
83
87
}
84
88
85
89
/**
@@ -220,6 +224,7 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
220
224
221
225
< div className = "ms-font-m" > TaxonomyPicker tester:
222
226
< TaxonomyPicker
227
+ initialValues = { this . state . initialValues }
223
228
allowMultipleSelections = { true }
224
229
termsetNameOrID = "b3e9b754-2593-4ae6-abc2-35345402e186"
225
230
// anchorId="0ec2f948-3978-499e-9d3f-e51c4494d44c"
@@ -232,6 +237,17 @@ export default class ControlsTest extends React.Component<IControlsTestProps, IC
232
237
context = { this . props . context }
233
238
onChange = { this . _onTaxPickerChange }
234
239
isTermSetSelectable = { false } />
240
+
241
+ < DefaultButton text = "Add" onClick = { ( ) => {
242
+ this . setState ( {
243
+ initialValues : [ {
244
+ key : "ab703558-2546-4b23-b8b8-2bcb2c0086f5" ,
245
+ name : "HR" ,
246
+ path : "HR" ,
247
+ termSet : "b3e9b754-2593-4ae6-abc2-35345402e186"
248
+ } ]
249
+ } ) ;
250
+ } } />
235
251
</ div >
236
252
< div className = "ms-font-m" > iframe dialog tester:
237
253
< PrimaryButton
0 commit comments