Skip to content

Bug/Feature Request: Search data other than "textField" using AJAX #134

Description

@acirinelli

When using typeahead-url, it seems reasonable to include other searchable columns besides the one appearing in the textField.

Example: Search for a list of users by name or email, but tag value is by name. The query will return the correct list of data, but the plugin doSearch function is filtering them out in the comparable mapping.

Activity

  1. changed the title [-]Bug: Cannot search fields other than "textField" using AJAX[/-] [+]Bug/Feature Request: Cannot search fields other than "textField" using AJAX[/+] on Mar 29, 2021
  2. changed the title [-]Bug/Feature Request: Cannot search fields other than "textField" using AJAX[/-] [+]Bug/Feature Request: Search data other than "textField" using AJAX[/+] on Mar 29, 2021
  3. acirinelli commented on Apr 7, 2021

    @acirinelli
    ContributorAuthor

    I've run into another example of this problem. I'm querying a database and removing characters such as spaces and periods and the results are being returned, but the plugin is stripping them out if they don't match what has been typed in. This is weird behavior IMO...

    Example:
    Database contains a string: 01 01 01 or 01.01.01
    If the user searches 010 I want the result to appear. The plugin should just be responsible for showing the results of an ajax query, not filtering them out.

  4. acirinelli commented on Apr 7, 2021

    @acirinelli
    ContributorAuthor
  5. premrajnarkhede commented on Jun 7, 2021

    @premrajnarkhede

    "If the user searches 010 I want the result to appear. The plugin should just be responsible for showing the results of an ajax query, not filtering them out."

    If any one else is having this problem and if you are only going to use AJAX and are dependent on .js version of this module.. Dirty fix is. Change line
    r.value:r.value.toLowerCase()).search(e)>-1
    changing this to
    r.value:r.value.toLowerCase()).search(e)>-2
    in voerro-vue-tagsinput.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions