1.0.1 • Published 3 years ago

@mdrajibul/sbox v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

sbox

A jQuery base plugin for dropdown and autocomplete.

Documentation

http://www.rajibul.me/p/sbox.html

Installation

# using npm
npm install --save @mdrajibul/sbox

Usage

In your Js/TS file as jQuery:

import $ from "jquery";

$(() => {
	$("#country").Sbox({ 
		width: '120px',
		typeHeader: false,
		dataStore: {
			json: [
				{
					id: 'usa',
					name: 'United states'
				},
				{
					id: 'uk',
					name: 'United kingdom'
				},
				{
					id: 'india',
					name: 'India'
				},
			],
		},
		listners: {
			onSelect: (el, data) => {
				console.log(el, data);
			},
		}
	});
});

In your Js/TS file without jQuery:

new Sbox({ 
	selector: $("#sboxElement"),// it should be jquery or HTML element
	width: "120px",
	typeHeader: false,
	dataStore: {
		arrayList: [ 'United states', 'United kingdom','India']
	},
	listners: {
		onSelect: (el, data) => {
			console.log(el, data);
		},
	}
});

More information please visit Sbox examples