wbraganca/yii2-selectivity The yii2-selectivity is a Yii 2 wrapper for [selectivity](https://arendjr.github.io/selectivity/). A modular and light-weight selection library for jQuery and Zepto.js.

dropdownmultiselectselectwbragancayii2-selectivity

yii2-selectivity

Latest Version Software License Total Downloads

Install

Via Composer

$ composer require wbraganca/yii2-selectivity

or add

"wbraganca/yii2-selectivity": "~2.0.1"

to the require section of your composer.json file.

Usage

On your view file.


<?php
use wbraganca\selectivity\SelectivityWidget;
?>

<?= $form->field($model, 'city', [
        'options' => ['class' => 'selectivity-container form-group']
    ])->widget(SelectivityWidget::classname(), [
    'options' => [
        'prompt' => '',
    ],
    'pluginOptions' => [
        'allowClear' => true,
        'data' => ['Rio de Janeiro', 'São Paulo'],
        'placeholder' => 'No city selected'

    ]
]) ?>

Displaying the data with appended addon

<?= $form->field($model, 'city', [
        'options' => ['class' => 'selectivity-container form-group']
    ])->widget(SelectivityWidget::classname(), [
    'options' => [
        'prompt' => ''
    ],
    'pluginOptions' => [
        'allowClear' => true,
        'data' => ['Rio de Janeiro', 'São Paulo'],
        'placeholder' => 'No city selected'
    ],
    'template' => '<div class="input-group">' .
        '{input}' .
        '<div class="input-group-append">' .
        '<span class="input-group-btn">' .
        '<button class="btn btn-success" type="button">' .
        '<i class="fa fa-plus"></i>' .
        '</button>' .
        '</div>' .
        '</span>' .
        '</div>'
]) ?>

For more options, visit: https://arendjr.github.io/selectivity/#api

Changelog

yii2-selectivity change Log

dev-master

version 2.0.2

Date: 18-Jul-2019

  • Bug: Fix display for multiple type fields.

version 2.0.1

Date: 02-Jul-2019

  • Enh: Adds support for displaying the error message block for 'input-group' fields.

version 2.0.0

Date: 02-Jul-2019

  • Bug: Add CSS class to display block of error messages.

version 2.0.0-beta.2

Date: 08-Jun-2019

  • Bug: Fix JavaScrtip events

version 2.0.0-beta.1

Date: 06-Jun-2019

  • Enh: Selectivity.js dependency updated to ~3.1.0

version 1.0.2

Date: 07-Nov-2015

  • Bug: Ensures correct value for empty attributes
  • Enh: Selectivity.js dependency updated to ^2.0.0

version 1.0.1

Date: 05-Nov-2015

  • Enh: Update .gitnore

version 1.0.0

Date: 04-Jul-2015

Initial release

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



2.0.2 is the latest of 8 releases



BSD-3-Clause license
Stats
6 github stars & 1 github forks
0 downloads in the last day
7 downloads in the last 30 days
3523 total downloads