coreui-form-field-select2

1.0.2 • Public • Published

Coreui form field select2

Online documentation

php repository

Install

npm install coreui-form-field-select2

Examples

<div id="single-select"></div>

<script>
    let options = [
        '--',
        'Reactive',
        'Solution',
        'Conglomeration',
        'Algoritm',
        'Holistic',
    ];

    CoreUI.form.create({
        send    : {
            url   : '/path/to/object/1',
            method: 'post'
        },
        record  : {
            select_field: null
        },
        fields  : [
            {
                type: 'select2', name: 'select_field', label: 'Select', width: 250, options: options, select2: {
                    placeholder: 'Choose one thing',
                }
            },
        ],
        onSubmit: function (form, data) {
            alert(JSON.stringify(data));
            return false;
        },
        controls: [
            {type: "submit", content: "Send"},
        ],
    }).render('single-select');
</script>

Package Sidebar

Install

npm i coreui-form-field-select2

Weekly Downloads

0

Version

1.0.2

License

ISC

Unpacked Size

2.31 MB

Total Files

26

Last publish

Collaborators

  • n2ref