Open Closed

Add new Option in Auto-Complete Select #4179


User avatar
0
Merna created

Hello, I'm using Auto-Complete Select in my application, but i need to add one more option to it in js that not included in the response of an api. **This all option that i need to add it in js ** Is there is a way to do it??

  • ABP Framework version: v7.0.0 rc3
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

6 Answer(s)
  • User Avatar
    0
    malik.masis created

    Hello Marna,

    As far as I understand, there is a PR to add this feature in the next version. You can have look at these changes.

    Also, could you have look at this official documentation please if you don't want to wait for the next version?

    Regards.

  • User Avatar
    0
    Merna created

    Hello Malik, I think you got me wrong, what I want is to add an extra option that is not in the response of the api . like having an api to get cities but I need to add one more option to search by all cities. so, I need to access options after api responds and append this new option in the specific index if I can. Regards.

  • User Avatar
    0
    malik.masis created

    Hello Merna,

    I see. In this case, if you remove your choice I think you will see all data. Am I wrong? You want to add a new option for all cities and I'm telling if you don't choose any option, already you will see all cities.

    For all that, you can add a new option by adding an option but also you need to handle it in your js file or whatever you want.

    Regards.

  • User Avatar
    0
    Merna created

    Hello Malik, about your question, first time you will see data related to all cities but after searching 4 the first time you won't have the ability/option to get data related to all cities again (Except refreshing the page again).

    when I tried to configure (select2==>data) in js it doesn't return the result of the api. so, if you have an example for handling this auto-complete select in js can you mention it.

    Regards.

  • User Avatar
    0
    Merna created

    Hello Malik, Are there any updates?

  • User Avatar
    0
    malik.masis created

    Hello Marna,

    Sorry for my late answer.

    I understand your issue. To handle that, you should make the ajax call if the value is empty/null. Firstly you should catch the event of the select box and make the call and get all data.

    There is detailed official documentation. Also, you can have a look at the Abp implementation from here.

    Hope it helps you.

    Regards.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 26, 2024, 06:07