• Stars
    star
    142
  • Rank 258,495 (Top 6 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 8 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Touch enabled selectable plugin inspired by the jQuery UI widget.

Selectable

Maintenance Code Climate maintainability npm license GitHub release npm GitHub issues GitHub issues

Inspired by the jQuery UI Selectable plugin. Functionality and options are identical to the jQuery UI version with some additions and performance enhancements.

Selectable mimics the Windows file / directory behaviour, i.e. click and / or drag to select items, hold CTRL to select multiple or hold SHIFT to select consecutive groups of items.

  • No dependencies
  • Lightweight
  • IE9+
  • Touch enabled

Selectable is still in active development and therefore the API is in constant flux until v1.0.0. Check back regularly for any changes and make sure you have the latest version installed.

Pull requests are welcome!

Demo | Documentation | Changelog | Table Plugin


Demos

Integration with other libs


Install

Bower

bower install selectable.js --save

npm

npm install selectable.js --save

Browser

Grab the file from one of the CDNs and include it in your page:

https://unpkg.com/selectable.js@latest/selectable.min.js

or

https://cdn.jsdelivr.net/npm/selectable.js@latest/selectable.min.js

You can replace latest with the required release number if needed.


Default

This will create a new instance and add any element found in the DOM with the "ui-selectable" class name and make them selectable.

const selectable = new Selectable();

Custom filter

If you don't add the "ui-selectable" class name to your items then simply tell the instance what to look for instead with the filter option:

const selectable = new Selectable({
   filter: ".my-classname"
});

// or

const selectable = new Selectable({
   filter: document.querySelectorAll(".my-classname")
});

NOTE: <a> elements will not work currently. See: #31

No items

If your document doesn't have any selectable items yet, e.g. they're added asynchronously via an ajax call, then simply create a new instance as normal, then use the add() method when they're available:

const selectable = new Selectable();

// items added to DOM ...

// then...
selectable.add(items);

Options

See Options


Public Methods

See Public Methods


Events

See Events


If this project helps you then you can grab me a coffee or beer to say thanks.

paypal


Copyright Β© 2017 Karl Saunders | BSD & MIT license

More Repositories

1

Pageable

Create full page scrolling web pages. No jQuery.
JavaScript
371
star
2

Vanilla-DataTables

A lightweight, dependency-free javascript HTML table plugin
JavaScript
366
star
3

Selectr

A lightweight, vanilla javascript select box replacement. No dependencies.
JavaScript
312
star
4

xperience

XP Ranking System for FiveM
Lua
69
star
5

rprogress

Customisable radial progress bars for FiveM
JavaScript
68
star
6

MiniBar

A lightweight scrollbar library written in vanilla javascript.
JavaScript
58
star
7

bulletin

Customisable notifications for FiveM
Lua
54
star
8

esx_xp

XP Ranking System for FiveM
Lua
45
star
9

vPrompt

3D Interactive Prompts for FiveM
Lua
37
star
10

ms-spycams

Deployable spy cameras for QBCore
Lua
28
star
11

Rangeable

Transform input range elements into something prettier and more configurable.
JavaScript
18
star
12

Editable

A table editor extension for Vanilla-DataTables.
JavaScript
16
star
13

esx_forklift

ESX forklift job for FiveM
Lua
14
star
14

FeedM

Customisable native feed notifications for FiveM
Lua
13
star
15

vInspector

Vehicle inspector for FiveM
Lua
12
star
16

esx_collectables

Collectable items for FiveM
Lua
11
star
17

NestableJS

JS library for drag & drop hierarchical lists
JavaScript
11
star
18

Exportable

A Vanilla-DataTables extension to allow for exporting table data to various formats.
JavaScript
7
star
19

Selectable-Table-Plugin

Plugin for Mobius1/Selectable that enables fast column / row selection.
JavaScript
7
star
20

AnimateUI

Animated UI Messages for FiveM
Lua
6
star
21

MetroCQL

MetroCQL - Metro Conquest Large
Lua
3
star
22

XpM

Framework agnostic XP ranking system for FiveM
Lua
3
star
23

GForceM

Vehicle G-Force meter for FiveM
Lua
3
star
24

Filterable

Vanilla-DataTables extension that adds inputs to each column for filtering.
JavaScript
2
star
25

VXCR

Virtual Xbox CD Ripper. Transfer audio files to your Xbox without having to rip from a CD.
Visual Basic
2
star
26

collectathon

Collectable items for FiveM
Lua
1
star