0

I am using the example from Github, but I am not sure how to filter the second dropdown list based on the selected value in the first list:

<MyAsyncDropdown label ="Select a site"
          loadingLabel = "loading"
          errorLabelFormat = "error"
          loadOptions = {this.loadSiteUrlOptions.bind(this)}
          onChange= {this.onChange.bind(this)}
        /> 
        <hr />

    <MyAsyncDropdown label ="Select a web"
      loadingLabel = "loading"
      errorLabelFormat = "error"
      loadOptions = {this.loadWebUrlOptions.bind(this)}
      onChange= {this.onChange.bind(this)}
    /> 

here are the functions which populate the options of each dropdownlist:

private loadSiteUrlOptions(): Promise<IDropdownOption[]> {

    return this.ContentQueryService.getSiteUrlOptions();
  }

  private loadWebUrlOptions(): Promise<IDropdownOption[]> {
    return this.ContentQueryService.getWebUrlOptions(this.props.siteUrl);
  }

how can I filter the values second dropdownlist based on onchange function? Which is this:

  private onChange(propertyPath: string, newValue: any): void {

  }

I am not using property panes. I am using the dropdowns directly in the web part.

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.