Skip to content

How to allow user input without autocompleting it with suggestion properly?  #405

Description

Hi there. Thank you so much for your your project.

It does exactly what I need and better then other that I've google for.

Test page https://find.dhamma.gift/vass.html

I use it with datatables 1.10 but I have few little problems

  1. How to set delimiter to " " (space). Now it suggests whole sentences but I need just separate words
    screenshot 1

  2. When user types a word e.g. "appa" and hits enter it automatically pastes the whole 1st sentence "Appamādasutta Diligence" from the suggestions. but user don't need the whole sentence but just users input in this case. How to allow user input in this case?
    screenshot 2

Code that I'm using right now

` 'initComplete': function(){
var api = this.api();

     // Populate a dataset for autocomplete functionality
     api.cells('tr', [0, 1, 2, 3, 4, 6]).every(function(){
                    var data = this.data().replace( /(<([^>]+)>)/ig, '');
        if(dataSrc.indexOf(data) === -1){ dataSrc.push(data); }
     });

     // Initialize Typeahead plug-in
     $('.dataTables_filter input[type="search"]', api.table().container())
        .typeahead({
           source: dataSrc,
           afterSelect: function(value){
              api.search(value).draw();
           }
        }
     );`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions