Logo Logo Nue Package
Getting Started Introduction
Getting Started Gulp
Getting Started Customization
Getting Started Credits
Getting Started Changelog
Design & Graphics Bootstrap Icons
Design & Graphics Illustrations
Components Accordion
Components Alerts
Components Avatars
Components Badge
Components Breadcrumb
Components Buttons
Components Button group
Components Cards
Components Collapse
Components Column divider
Components Devices
Components Divider
Components Dropdowns
Components Icons
Components List Group
Components Lists
Components Legend Indicator
Components Modal
Components Offcanvas
Components Page Header
Components Pagination
Components Popovers
Components Progress
Components Profile
Components Shapes
Components Sliding Image
Components Spinners
Components Steps
Components Tab
Components Toasts
Components Tooltips
Components Typography
Navbars Navbar
Navbars Navs
Navbars Mega Menu
Navbars Navbar Vertical Aside
Navbars Scrollspy
Tables Tables
Tables Datatables
Tables Sticky Header
Basic forms Basic forms
Basic forms Checks and switches
Basic forms Input group
Utilities Backgrounds
Utilities Borders
Utilities Colors
Utilities Links
Utilities Position
Utilities Rotations
Utilities Shadows
Utilities Sizing
Utilities Spacing
Utilities Z-index
Utilities Opacity
Advanced forms Advanced select
Advanced forms Datepicker
Advanced forms Date Range Picker
Advanced forms Calendar (Fullcalendar)
Advanced forms File attachments
Advanced forms Drag’ n’ drop file uploads
Advanced forms WYSIWYG Editor
Advanced forms Quantity counter
Advanced forms Copy to Clipboard
Advanced forms Input mask
Advanced forms Step forms (Wizards)
Advanced forms Wizards
Advanced forms Add field
Advanced forms Toggle password
Advanced forms Count characters
Advanced forms Form Search
Advanced forms Toggle switch
Advanced forms Google reCAPTCHA
Others Chart.js
Others Counter
Others Circles.js (Pie Chart)
Others Fullscreen Lightbox
Others Leaflet
Others JSVectorMap
Others SortableJS
Others Sticky block
Others Go To

No Results

  • Preview Demo
Logo Nµe
  • Nue
  • UI (HTML)
  • Getting Started
  • Introduction
  • Credits
  • Design & Graphics
  • Bootstrap Icons
  • Iconify Design
  • Illustrations
  • Components
  • Accordion
  • Alerts
  • Avatars
  • Badge
  • Breadcrumb
  • Buttons
  • Button Group
  • Cards
  • Collapse
  • Column Divider
  • Devices
  • Divider
  • Dropdowns
  • Icons
  • List Group
  • Lists
  • Legend Indicator
  • Modal
  • Offcanvas
  • Page Header
  • Pagination
  • Popovers
  • Progress
  • Profile
  • Shapes
  • Sliding Image
  • Spinners
  • Steps
  • Tab
  • Toasts
  • Tooltips
  • Typography
  • Navbars
  • Navbar
  • Navs
  • Mega Menu
  • Navbar Vertical Aside
  • Scrollspy
  • Tables
  • Tables
  • Datatables
  • Sticky Header
  • Basic Forms
  • Basic Forms
  • Checks & Switches
  • Input Group
  • Advanced Forms
  • Advanced Select
  • Datepicker (Flatpickr)
  • Date Range Picker
  • Calendar (Fullcalendar)
  • File Attachments
  • Drag n' Drop Uploads
  • WYSIWYG Editor
  • Quantity Counter
  • Copy to Clipboard
  • Input Mask
  • Step Forms (Wizards)
  • Add Field
  • Toggle Password
  • Count Characters
  • Form Search
  • Toggle Switch
  • Google reCAPTCHA
  • Charts
  • Chart.js
  • Counter
  • Circles.js (Pie Chart)
  • Others
  • Fullscreen Lightbox
  • Leaflet
  • JSVectorMap
  • SortableJS
  • Sticky Block
  • Go To
  • Utility
  • Backgrounds
  • Borders
  • Colors
  • Links
  • Position
  • Shadows
  • Sizing
  • Spacing
  • Z-Index
  • Opacity

SortableJS

Dokumentasi SortableJS

Cara Pakai

Copy-paste script berikut sebelum tag penutup <body>

    
      <script>
        (function() {
          // INITIALIZATION OF SORTABLE
          // =======================================================
          Nue.components.NueSortable.init('.js-sortable')
        });
      </script>
    
  

Simple list example

  • Preview
  • HTML
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
        
          <!-- List Group -->
          <div class="js-sortable sortablejs-custom list-group"
              data-nue-sortable-options='{
                "animation": 150,
                "group": "listGroup"
              }'>
           <div class="list-group-item">Item 1</div>
           <div class="list-group-item">Item 2</div>
           <div class="list-group-item">Item 3</div>
           <div class="list-group-item">Item 4</div>
           <div class="list-group-item">Item 5</div>
           <div class="list-group-item">Item 6</div>
         </div>
          <!-- End List Group -->
        
      

Shared lists

  • Preview
  • HTML
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
        
          <div class="row">
            <div class="col-md-6">
              <!-- List Group -->
              <div class="js-sortable sortablejs-custom list-group"
                   data-nue-sortable-options='{
                     "animation": 150,
                     "group": "listGroup"
                   }'>
                <div class="list-group-item">Item 1</div>
                <div class="list-group-item">Item 2</div>
                <div class="list-group-item">Item 3</div>
                <div class="list-group-item">Item 4</div>
                <div class="list-group-item">Item 5</div>
                <div class="list-group-item">Item 6</div>
              </div>
              <!-- End List Group -->
            </div>

            <div class="col-md-6">
              <!-- List Group -->
              <div class="js-sortable sortablejs-custom list-group"
                   data-nue-sortable-options='{
                     "animation": 150,
                     "group": "listGroup"
                   }'>
                <div class="list-group-item bg-light">Item 1</div>
                <div class="list-group-item bg-light">Item 2</div>
                <div class="list-group-item bg-light">Item 3</div>
                <div class="list-group-item bg-light">Item 4</div>
                <div class="list-group-item bg-light">Item 5</div>
                <div class="list-group-item bg-light">Item 6</div>
              </div>
              <!-- End List Group -->
            </div>
          </div>
          <!-- End Row -->
        
      

Disable sorting

Try sorting the list on the left. It is not possible because it has it's sort option set to false. However, you can still drag from the list on the left to the list on the right.

  • Preview
  • HTML
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
        
          <div class="row">
            <div class="col-md-6">
              <!-- List Group -->
              <div class="js-sortable sortablejs-custom list-group"
                   data-nue-sortable-options='{
                     "animation": 150,
                     "group": {
                       "name": "listGroup3",
                       "pull": "clone",
                       "put": false
                     }
                   }'>
                <div class="list-group-item">Item 1</div>
                <div class="list-group-item">Item 2</div>
                <div class="list-group-item">Item 3</div>
                <div class="list-group-item">Item 4</div>
                <div class="list-group-item">Item 5</div>
                <div class="list-group-item">Item 6</div>
              </div>
              <!-- End List Group -->
            </div>

            <div class="col-md-6">
              <!-- List Group -->
              <div class="js-sortable sortablejs-custom list-group"
                   data-nue-sortable-options='{
                     "animation": 150,
                     "group": "listGroup3"
                   }'>
                <div class="list-group-item bg-light">Item 1</div>
                <div class="list-group-item bg-light">Item 2</div>
                <div class="list-group-item bg-light">Item 3</div>
                <div class="list-group-item bg-light">Item 4</div>
                <div class="list-group-item bg-light">Item 5</div>
                <div class="list-group-item bg-light">Item 6</div>
              </div>
              <!-- End List Group -->
            </div>
          </div>
          <!-- End Row -->
        
      

Handle

  • Preview
  • HTML
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
        
          <!-- List Group -->
          <div class="js-sortable sortablejs-custom list-group"
              data-nue-sortable-options='{
                "animation": 150,
                "handle": ".sortablejs-custom-handle"
              }'>
            <div class="list-group-item">
              <i class="sortablejs-custom-handle bi-grip-horizontal list-group-icon"></i> Item 1
            </div>
            <div class="list-group-item">
              <i class="sortablejs-custom-handle bi-grip-horizontal list-group-icon"></i> Item 2
            </div>
            <div class="list-group-item">
              <i class="sortablejs-custom-handle bi-grip-horizontal list-group-icon"></i> Item 3
            </div>
            <div class="list-group-item">
              <i class="sortablejs-custom-handle bi-grip-horizontal list-group-icon"></i> Item 4
            </div>
            <div class="list-group-item">
              <i class="sortablejs-custom-handle bi-grip-horizontal list-group-icon"></i> Item 5
            </div>
            <div class="list-group-item">
              <i class="sortablejs-custom-handle bi-grip-horizontal list-group-icon"></i> Item 6
            </div>
          </div>
          <!-- End List Group -->
        
      

Filter

Try dragging the item with a red background. It cannot be done, because that item is filtered out using the filter option.

  • Preview
  • HTML
Item 1
Filtered
Item 3
Item 4
Item 5
Item 6
        
          <!-- List Group -->
          <div class="js-sortable list-group"
               data-nue-sortable-options='{
                  "animation": 150,
                  "filter": ".sortablejs-custom-disabled"
                }'>
            <div class="list-group-item">Item 1</div>
            <div class="list-group-item sortablejs-custom-disabled bg-danger text-white">Filtered</div>
            <div class="list-group-item">Item 3</div>
            <div class="list-group-item">Item 4</div>
            <div class="list-group-item">Item 5</div>
            <div class="list-group-item">Item 6</div>
          </div>
          <!-- End List Group -->
        
      

Grid

  • Preview
  • HTML
1
2
3
4
5
6
7
8
9
10
11
12
        
          <!-- List Group -->
          <div class="js-sortable row"
               data-nue-sortable-options='{
                 "animation": 150,
                 "ghostClass": "sortablejs-custom-chosen-child"
               }'>
            <div class="col-md-2 mb-3">
              <div class="card">
                <div class="card-body text-center">1</div>
              </div>
            </div>

            <div class="col-md-2 mb-3">
              <div class="card">
                <div class="card-body text-center">2</div>
              </div>
            </div>

            <div class="col-md-2 mb-3">
              <div class="card">
                <div class="card-body text-center">3</div>
              </div>
            </div>

            <div class="col-md-2 mb-3">
              <div class="card">
                <div class="card-body text-center">4</div>
              </div>
            </div>

            <div class="col-md-2 mb-3">
              <div class="card">
                <div class="card-body text-center">5</div>
              </div>
            </div>

            <div class="col-md-2 mb-3">
              <div class="card">
                <div class="card-body text-center">6</div>
              </div>
            </div>

            <div class="col-md-2 mb-3">
              <div class="card">
                <div class="card-body text-center">7</div>
              </div>
            </div>

            <div class="col-md-2 mb-3">
              <div class="card">
                <div class="card-body text-center">8</div>
              </div>
            </div>

            <div class="col-md-2 mb-3">
              <div class="card">
                <div class="card-body text-center">9</div>
              </div>
            </div>

            <div class="col-md-2 mb-3">
              <div class="card">
                <div class="card-body text-center">10</div>
              </div>
            </div>

            <div class="col-md-2 mb-3">
              <div class="card">
                <div class="card-body text-center">11</div>
              </div>
            </div>

            <div class="col-md-2 mb-3">
              <div class="card">
                <div class="card-body text-center">12</div>
              </div>
            </div>
          </div>
          <!-- End List Group -->
        
      

Nested

  • Preview
  • HTML
Item 1
Item 2

Item 3

Item 3.1
Item 3.2
Item 3.3
Item 3.4
Item 4
Item 5
Item 6
        
          <!-- List Group -->
          <div class="js-sortable list-group"
              data-nue-sortable-options='{
                "animation": 150,
                "group": "listGroup4",
                "fallbackOnBody": true
              }'>
            <div class="list-group-item">Item 1</div>
            <div class="list-group-item">Item 2</div>
            <div class="list-group-item">
              <h4 class="h5">Item 3</h4>

              <div class="js-sortable list-group"
                   data-nue-sortable-options='{
                     "animation": 150,
                     "group": "listGroup5"
                   }'>
                <div class="list-group-item">Item 3.1</div>
                <div class="list-group-item">Item 3.2</div>
                <div class="list-group-item">Item 3.3</div>
                <div class="list-group-item">Item 3.4</div>
              </div>
            </div>
            <div class="list-group-item">Item 4</div>
            <div class="list-group-item">Item 5</div>
            <div class="list-group-item">Item 6</div>
          </div>
          <!-- End List Group -->
        
      

Multiple Drag

The MultiDrag option allows for multiple items to be dragged at a time. You can click to "select" multiple items, and then drag them as one item.

Use "multiDrag": true

  • Preview
  • HTML
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
        
          <!-- List Group -->
          <div class="js-sortable list-group"
               data-nue-sortable-options='{
                 "animation": 150,
                 "multiDrag": true,
                 "selectedClass": "active"
               }'>
            <div class="list-group-item">Item 1</div>
            <div class="list-group-item">Item 2</div>
            <div class="list-group-item">Item 3</div>
            <div class="list-group-item">Item 4</div>
            <div class="list-group-item">Item 5</div>
            <div class="list-group-item">Item 6</div>
          </div>
          <!-- End List Group -->
        
      

Swap

The Swap option changes the behaviour of Sortable to allow for items to be swapped with eachother rather than sorted.

Use "swap": true

  • Preview
  • HTML
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
        
          <!-- List Group -->
          <div class="js-sortable list-group"
               data-nue-sortable-options='{
                 "animation": 150,
                 "swap": true,
                 "swapClass": "active"
               }'>
            <div class="list-group-item">Item 1</div>
            <div class="list-group-item">Item 2</div>
            <div class="list-group-item">Item 3</div>
            <div class="list-group-item">Item 4</div>
            <div class="list-group-item">Item 5</div>
            <div class="list-group-item">Item 6</div>
          </div>
          <!-- End List Group -->
        
      

Links

  • Preview
  • HTML
Sortable with link 1 Sortable with link 2 Sortable with link 3 Sortable with link 4 Sortable with link 5 Sortable with link 6
        
          <!-- List Group -->
          <div class="js-sortable list-group">
            <a class="js-sortable list-group-item sortablejs-custom-handle" href="#">Sortable with link 1</a>
            <a class="js-sortable list-group-item sortablejs-custom-handle" href="#">Sortable with link 2</a>
            <a class="js-sortable list-group-item sortablejs-custom-handle" href="#">Sortable with link 3</a>
            <a class="js-sortable list-group-item sortablejs-custom-handle" href="#">Sortable with link 4</a>
            <a class="js-sortable list-group-item sortablejs-custom-handle" href="#">Sortable with link 5</a>
            <a class="js-sortable list-group-item sortablejs-custom-handle" href="#">Sortable with link 6</a>
          </div>
          <!-- End List Group -->
        
      

Data-href with modal example

  • Preview
  • HTML
Sortable with modal link 1 Sortable with modal link 2 Sortable with modal link 3 Sortable with modal link 4 Sortable with modal link 5 Sortable with modal link 6
Modal title
...
        
          <!-- List Group -->
          <div class="js-sortable list-group">
            <a class="js-sortable-modal-link list-group-item sortablejs-custom-handle" data-bs-toggle="modal" data-bs-target="#exampleModal" href="javascript:;">Sortable with modal link 1</a>
            <a class="js-sortable-modal-link list-group-item sortablejs-custom-handle" data-bs-toggle="modal" data-bs-target="#exampleModal" href="javascript:;">Sortable with modal link 2</a>
            <a class="js-sortable-modal-link list-group-item sortablejs-custom-handle" data-bs-toggle="modal" data-bs-target="#exampleModal" href="javascript:;">Sortable with modal link 3</a>
            <a class="js-sortable-modal-link list-group-item sortablejs-custom-handle" data-bs-toggle="modal" data-bs-target="#exampleModal" href="javascript:;">Sortable with modal link 4</a>
            <a class="js-sortable-modal-link list-group-item sortablejs-custom-handle" data-bs-toggle="modal" data-bs-target="#exampleModal" href="javascript:;">Sortable with modal link 5</a>
            <a class="js-sortable-modal-link list-group-item sortablejs-custom-handle" data-bs-toggle="modal" data-bs-target="#exampleModal" href="javascript:;">Sortable with modal link 6</a>
          </div>
          <!-- End List Group -->

          <!-- Modal -->
          <div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
            <div class="modal-dialog">
              <div class="modal-content">
                <div class="modal-header">
                  <h5 class="modal-title" id="exampleModalLabel">Modal title</h5>
                  <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
                <div class="modal-body">
                  ...
                </div>
                <div class="modal-footer">
                  <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                  <button type="button" class="btn btn-primary">Save changes</button>
                </div>
              </div>
            </div>
          </div>
          <!-- End Modal -->
        
      

Methods

ParameterDeskripsiNilai default

ghostClass

Class when draging.sortable-chosen-main