Skip to content

n2ref/coreui-form-field-select2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published