Open Closed

ABP autocomplete based on input value #6979


User avatar
0
rohit.jadhav created

Is it possible to populate the dropdown based on another dropdown selected value ?

Ex: if we use auto complete to list all cities based on a selected country in another dropdown, is it possible to do it in ABP ?

The below documentation does not mention about it.

https://docs.abp.io/en/abp/latest/UI/AspNetCore/AutoComplete-Select


1 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    You can use select2: https://select2.org/data-sources/ajax#request-parameters

    Add parameters in AJAX request:

    $('#mySelect2').select2({
      ajax: {
        url: 'https://api.github.com/orgs/select2/repos',
        data: function (params) {
          var query = {
            filter: params.term,
            country: $("#country").val() // your country selected value
          }
    
          return query;
        }
      }
    });
    
Made with ❤️ on ABP v9.1.0-preview. Updated on November 11, 2024, 11:11