Giter Site home page Giter Site logo

saravanajd / autocomplete Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 166 KB

A lightweight, flexible, fast jQuery autocomplete/typehead plugin which automatically suggests matching items while typing keywords

Home Page: https://saravanajd.github.io/autocomplete/index.html

License: MIT License

CSS 36.86% JavaScript 22.79% HTML 40.34%
autocomplete autocomplete-search typehead jquery-plu jquery autocomplete-jquery-plugin lightweight-autocomplete

autocomplete's Introduction

A lightweight, flexible, fast jQuery autocomplete/typehead plugin which automatically suggests matching items while typing keywords(search items) in a text field. This plugin enables your users to quickly filter, find and select items from huge lists such as user list, country list, search results and more.

Demo

You can view a live demo and some examples of how to use the various options here.

Add the class autocomplete

<input type="text" class="autocomplete" value="">

How do use autocomplete

const country = [{Id:1,Name:'India'},{Id:2,Name:'Japan'},{Id:3,Name:'US'}];
$('.autocomplete').autocomplete({
      dataSource: country,
      textProperty:'Name',
      valueProperty:'Id'      
    });
    

All default options to customize the autocomplete

$('.yearpicker').yearpicker({

  // Text property of an array
  textProperty: 'name',
  // value propertu of an array
  valueProperty: 'value',
  // array
  dataSource: [],
  // default selected value
  defaultValue: '',
  // if text is not matched then default value
  notMatchedValue: '',
  // delay in mili seconds seach text while typing
  keyboardDelay: 500,
  // show no result text if result is not match
  showNoResults: false,
  // show matched charected in bold
  markAsBold: true,
  // close the dropdown on select
  closeOnSelect: true,
  // allow custom value
  allowCustomValue: true,
  // add class for selected item
  selectedClass: '',
  // autocomplete container class
  wrapClass: ''
  
});

autocomplete's People

Contributors

saravanajd avatar saravananest avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

sree0812

autocomplete's Issues

how to use onClick

Hello, is there an example which shows how to use the onClick option?
Would like to get the data-value of the selected item.
Currently using this little function but the onClick would be handier :)

$('.search').on('click','.autocomplete-list',function(){ window.location.href = '/'+$(this).find('li.selected').attr('data-value'); })

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.