2017 © Pedro Peláez
 

yii2-extension yii2-html5sortable-widget

Wrapper around the HTML5sortable JQuery plugin

image

raoul2000/yii2-html5sortable-widget

Wrapper around the HTML5sortable JQuery plugin

  • Monday, July 21, 2014
  • by raoul2000
  • Repository
  • 1 Watchers
  • 1 Stars
  • 16 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 7 % Grown

The README.md

yii2-html5sortable-widget

Wrapper around "HTML5 Sortable", a jQuery plugin to create sortable lists and grids using native HTML5 drag and drop API., (*1)

Check out the HTML5 Sortable for demo of the Plugin., (*2)

Please note that this extension does not provide any aditionnal feature than the one available in the wrapped plugin. It has no other dependency than the Yii2 Framework, (*3)

Installation

The preferred way to install this extension is through composer., (*4)

Either run, (*5)

php composer.phar require --prefer-dist raoul2000/yii2-html5sortable-widget "*"

or add, (*6)

"raoul2000/yii2-html5sortable-widget": "*"

to the require section of your composer.json file., (*7)

Usage

This is an example no how to use this extension once it is installed. First, create an HTML bootstrap list group :, (*8)

        <ul class="list-group sortable" style="min-height: 42px;">
          <li class="list-group-item"><span class="glyphicon glyphicon-align-justify"></span> Cras justo odio</li>
          <li class="list-group-item disabled "><span class="glyphicon glyphicon-align-justify"></span> can't be dragged because of disabled class</li>
          <li class="list-group-item"><span class="glyphicon glyphicon-align-justify"></span> Morbi leo risus</li>
          <li class="list-group-item"><span class="glyphicon"></span>can't be dragged because the handle is missing !</li>
          <li class="list-group-item"><span class="glyphicon glyphicon-align-justify"></span> Vestibulum at eros</li>
        </ul>

Then let's add some styling so our list items render nicely when drag and dropped :, (*9)

    li.list-group-item {
        height:42px;
    }
    li.sortable-placeholder {
        border: 1px dashed #CCC;
        background: #eeeeee;
        height:42px;
        list-style: none;
    }

Finally, make is HTML 5 Sortable by inserting following code :, (*10)

<?php 

    echo raoul2000\widget\html5sortable\Html5Sortable::widget([
        'selector' => '.sortable',
        'sortupdate' => new yii\web\JsExpression('function(){console.log("update");}'),
        'pluginOptions' => [
            'handle' => '.glyphicon-align-justify',
            'items' => ':not(.disabled)'
        ]
    ]);
?>

For more information on the plugin options and usage, please refer to html5sortable@github., (*11)

License

yii2-html5sortable-widget is released under the BSD 3-Clause License. See the bundled LICENSE.md for details., (*12)

The Versions

21/07 2014

dev-master

9999999-dev

Wrapper around the HTML5sortable JQuery plugin

  Sources   Download

BSD-3-Clause

The Requires

 

plugin extension yii2 jquery drag sort drop

28/06 2014

1.0.0

1.0.0.0

Wrapper around the HTML5sortable JQuery plugin

  Sources   Download

BSD-3-Clause

The Requires

 

plugin extension yii2 jquery drag sort drop