Code Monkey home page Code Monkey logo

jquery-string-list-input's Introduction

Welcome to jquery-string-list-input

jQuery widget for string list input. This is useful for input/textarea html tags that are supposed to store a list of strings where the order is important. Thus, it uses jqueryui-sortable to allow reordering of the list.

avr -30-2017 19-46-34

Installation

Using Bower:

bower install jquery-string-list-input

Using NPM:

npm install jquery-string-list-input

Or simply copy jquery-string-list-input.css and jquery-string-list-input.js files to your project.

Example

Basic example

    $('#textarea[data-provide="string-list-input"]').stringListInput({
    });

Custom labels

    $('#textarea[data-provide="string-list-input"]').stringListInput({
        addText: 'I want to add a text',
        labelText: 'My custom text',
        removeText: 'I want to delete this text',
    });

With suggestions

    $('#textarea[data-provide="string-list-input"]').stringListInput({
        suggestions: ['apple', 'facebook', 'google', 'amazon'],
    });

Custom events

    $('#textarea[data-provide="string-list-input"]').stringListInput({
        onUpdate: function(items) {
            alert(JSON.stringify(items));
        }
    });

Reference

Options

Option Default Mandatory Description
addText 'Add' No Display text on Add button
cursor 'move' No cursor option for jquery-ui sortable
distance 5 No distance option for jquery-ui sortable
hide true No Hide original input
labelText 'Expression' No Display text above each generated input
opacity .5 No opacity option for jquery-ui sortable
removeText 'Delete' No Display text on delete buttons
suggestions [] No Suggestions in each input generated. Requires jquery-textcomplete

Events

Option Default Mandatory Description
onUpdate undefined No Triggered every time the input is updated.

Dependencies

Usage

License

Please see LICENSE for licensing details.

jquery-string-list-input's People

Contributors

gtnx avatar

Watchers

 avatar

Forkers

oxbow

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.