0

I would like to know if there is a way to print the selected value of a Dropdown menu that is inside the Property Pane in SPFX.

Like, in my case, how to make it print with a console.log "Ascending" or "Descending" when selected from the Dropdown, or at least the respective key ('ASC' or 'DES')

Here is my code:

PropertyPaneDropdown('ItemsDropDown',{  
    label: "Sort by",  
    options: [
        { key: 'ASC', text: 'Ascending' },
        { key: 'DES', text: 'Descending' }
    ],
    selectedKey: strings.SelectedKeyDropdown,
})

Here is a screenshoot of my Dropdown

enter image description here

3
  • Which framework are you using, ReactJS?
    – willman
    Mar 19 '20 at 20:46
  • Pure Sharepoint Framework, nothing else Mar 19 '20 at 20:54
  • Or, willman, if you know a way of doing it using React I will really appreciate it if you tell me! Mar 19 '20 at 21:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.