.draggable-zone
and define draggable elements with .draggable
and let drag & drop through .draggable-handle
element.
var containers = document.querySelectorAll(".draggable-zone");
if (containers.length === 0) {
return false;
}
var swappable = new Sortable.default(containers, {
draggable: ".draggable",
handle: ".draggable .draggable-handle",
mirror: {
//appendTo: selector,
appendTo: "body",
constrainDimensions: true
}
});
<div class="row row-cols-lg-2 g-10 draggable-zone">
<div class="col draggable">
<!--begin::Card-->
<div class="card card-bordered">
...
</div>
<!--end::Card-->
</div>
<div class="col draggable">
<!--begin::Card-->
<div class="card card-bordered">
...
</div>
<!--end::Card-->
</div>
<div class="col draggable">
<!--begin::Card-->
<div class="card card-bordered">
...
</div>
<!--end::Card-->
</div>
<div class="col draggable">
<!--begin::Card-->
<div class="card card-bordered">
...
</div>
<!--end::Card-->
</div>
<div class="col draggable">
<!--begin::Card-->
<div class="card card-bordered">
...
</div>
<!--end::Card-->
</div>
<div class="col draggable">
<!--begin::Card-->
<div class="card card-bordered">
...
</div>
<!--end::Card-->
</div>
<div class="col draggable">
<!--begin::Card-->
<div class="card card-bordered">
...
</div>
<!--end::Card-->
</div>
<div class="col draggable">
<!--begin::Card-->
<div class="card card-bordered">
...
</div>
<!--end::Card-->
</div>
<div class="col draggable">
<!--begin::Card-->
<div class="card card-bordered">
...
</div>
<!--end::Card-->
</div>
<div class="col draggable">
<!--begin::Card-->
<div class="card card-bordered">
...
</div>
<!--end::Card-->
</div>
</div>
Pro Version Benefits | Free | Pro |
---|---|---|
UI Elements | 20 | 100 |
In-house Components | 20 | 40 |
Crafted Pages | 5 | 20 |
Complete Documentation | ||
Product Support | ||
Layout Builder | ||
Source Vectors | ||
Email Templates | ||
Calendar App | ||
User Management App | ||
Chat App | ||
Customers App |