Giter VIP home page Giter VIP logo

select2's Introduction

Drop2 Features

  • single select dropdown
  • Multi-select dropdown
  • search dropdown list
  • arrows keys support
  • limit the number of items displayed in a dropdown
  • custom sort
  • Listed items in separate boxes
  • Custom header and Placeholder and icons
  • Select all and Clear all options
  • Action Buttons like Submit and Cancel
  • Custom themes
  • Badges like count

Example

Demo : https://drop2.netlify.app/

Installation

https://github.com/Thamilgnanasambandan-st/Select2

Initilization

$('#demo').drop2()

Options

Badge

Show selected options count

type: boolean
default: false

Example: Example:

$('#demo').drop2({
    countBadge: true
});

Selected Drawer

Show Selected options separately

type: boolean
default: false

Example:

$('#demo').drop2({
    selectedDrawer: true
});

Update Value

Show Selected options separately

Example:

$('#demo').('['v1']')
$('#car').drop2('updateList');

Custom Header

We can define custom headers with icons but its not placeholder

type: boolean
default: false

Example:

$('#demo').drop2({
    customeheader :' <i class="fa-solid fa-download"></i> Select User',
});

Options show

This is define number of items shows in drawer

type: Number
default: 5

Example:

$('#demo').drop2({
    customeheader :' <i class="fa-solid fa-download"></i> Select User',
});

Events

open

triggers when drop2 is open

Example:

$(document).on('drop2-select-show', '#demo, function(){
   console.log('trigerrred - S');
});

hide

triggers when drop2 is close

Example:

$(document).on('drop2-select-hide', '#demo, function(){
   console.log('trigerrred - H');
});

Submit

triggers when drop2 multiple options submitted

Example:

$(document).on('drop2-select-submitted', '#demo', function(){
   console.log('trigerrred - H');
});

select2's People

Contributors

thamilgnanasambandan-st avatar

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.