angular-sortable

WebJar for angular-sortable

Лицензия

Лицензия

Категории

Категории

Angular Взаимодействие с пользователем Веб-фреймворки
Группа

Группа

org.webjars.bower
Идентификатор

Идентификатор

angular-sortable
Последняя версия

Последняя версия

0.3.3
Дата

Дата

Тип

Тип

jar
Описание

Описание

angular-sortable
WebJar for angular-sortable
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/schartier/angular-sortable

Скачать angular-sortable

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.bower/angular-sortable/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>angular-sortable</artifactId>
    <version>0.3.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/angular-sortable/
implementation 'org.webjars.bower:angular-sortable:0.3.3'
// https://jarcasting.com/artifacts/org.webjars.bower/angular-sortable/
implementation ("org.webjars.bower:angular-sortable:0.3.3")
'org.webjars.bower:angular-sortable:jar:0.3.3'
<dependency org="org.webjars.bower" name="angular-sortable" rev="0.3.3">
  <artifact name="angular-sortable" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='angular-sortable', version='0.3.3')
)
libraryDependencies += "org.webjars.bower" % "angular-sortable" % "0.3.3"
[org.webjars.bower/angular-sortable "0.3.3"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.webjars.bower : angular jar [1.2.22,1.3)
org.webjars.bower : jquery jar [2.1.1,2.2)

Модули Проекта

Данный проект не имеет модулей.

angular-sortable

Very simple jquery-ui like sortable that does not require jquery-ui... Look further to see the features that are not implemented yet :)

I am trying to make the best sortable directive for Angular.js, your contribution is very welcome :)

I figured out that when we detect that the order should be updated, instead of proceeding to complex DOM manipulations, updating the referenced array would produce the same result, the "Angular" way (this is my personal opinion)...

Installation

bower install angular-sortable --save

Usage

See example (index.html)

Related attributes

Options are defined as tag attributes:

  • ng-sortable (required) : The value for this attribute must be the same list used by the inner ng-repeat that create the sortable elements.
  • ng-sortable-on-change (optional)
  • ng-sortable-on-dragstart (optional)
  • ng-sortable-on-dragend (optional)
  • ng-sortable-on-drag (optional)

Example

HTML:

<ul ng-sortable="items"
    ng-sortable-on-change="onItemsChange"
    ng-sortable-on-dragstart="onItemsDragstart"
    ng-sortable-on-dragend="onItemsDragend"
    ng-sortable-on-drag="onItemsDrag">
    
    <li ng-repeat="item in items" class="sortable-element" ng-style="{backgroundColor: item.color}">
      {{item.name}}, {{item.profession}}
    </li>
</ul>

Controller

    $scope.onItemsDrag = function(event) {
        // Do whatever you want here...
        console.log('onItemsDrag');
    };

    $scope.onItemsDragstart = function(event) {
        // Do whatever you want here...
        console.log('onItemsDragstart');
    };

    $scope.onItemsDragend = function(event) {
        // Do whatever you want here...
        console.log('onItemsDragend');
    };

    $scope.onItemsChange = function(fromIdx, toIdx) {
        // Do whatever you want here...
        console.log('onItemsChange');
    };

Important features missing in this component

Версии библиотеки

Версия
0.3.3