| Name | Type | Default |
|
appendTo
# |
String
|
'parent'
|
Defines where the helper that moves with the mouse is being appended to during the drag (for example, to resolve overlap/zIndex issues).
<template>
<JqxSortable ref="mySortable" :appendTo="'document.body'">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
axis
# |
String
|
null
|
If defined, the items can be dragged only horizontally or vertically.
Possible Values:
'x'
'y'
<template>
<JqxSortable ref="mySortable" :axis="'y'">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
cancel
# |
String
|
'input,textarea,button,select,option'
|
Prevents sorting if you start on elements matching the selector.
<template>
<JqxSortable ref="mySortable" :cancel="'.not-sortable-item'">
<div class="not-sortable-item">1</div>
<div class="sortable-item">2</div>
<div class="sortable-item">3</div>
<div class="sortable-item">4</div>
<div class="sortable-item">5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
connectWith
# |
String
|
true
|
A selector of other sortable elements that the items from this list should be connected to.
<template>
<div>
<JqxSortable ref="mySortable1Ref" :autoCreate="false"></JqxSortable>
<JqxSortable ref="mySortable2Ref" :autoCreate="false"></JqxSortable>
</div>
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
const mySortable1Ref = ref(null);
const mySortable2Ref = ref(null);
const options = ref({ connectWith: '.sortable', opacity: 0.5 });
const firstNames = ref([
'Nancy',
'Andrew',
'Janet',
'Margaret',
'Steven',
'Michael',
'Robert',
'Laura',
'Anne'
]);
const lastNames = ref([
'Davolio',
'Fuller',
'Leverling',
'Peacock',
'Buchanan',
'Suyama',
'King',
'Callahan',
'Dodsworth'
]);
function loadInfo() {
let sortableList1 = '';
let sortableList2 = '';
const firstNamesHalf = Math.floor(this.firstNames.length / 2);
for (let i = 0; i < this.firstNames.length; i++) {
const element = '<div>' + this.firstNames[i] + ' ' + this.lastNames[i] + '</div>';
if (i < firstNamesHalf) {
sortableList1 = sortableList1 + element;
} else {
sortableList2 = sortableList2 + element;
}
}
const mySortable1 = mySortable1Ref.value.$el;
const mySortable2 = mySortable2Ref.value.$el;
mySortable1.classList.add('sortable');
mySortable2.classList.add('sortable');
mySortable1.innerHTML = sortableList1;
mySortable2.innerHTML = sortableList2;
}
onMounted(() => {
loadInfo();
mySortable1Ref.value.createComponent(options.value);
mySortable2Ref.value.createComponent(options.value);
});
</script>
<style>
.jqx-sortable {
margin: 2px;
padding: 5px;
float: left;
width: 200px;
border: lightblue solid 1px;
margin-right: 30px;
}
.jqx-sortable div {
border-radius: 5px;
padding: 5px;
cursor: pointer;
background-color: white;
color: black;
border: 1px solid transparent;
}
.jqx-sortable div:hover {
border: 1px solid #356aa0;
}
</style>
|
|
containment
# |
String
|
false
|
Defines a bounding box that the sortable items are constrained to while dragging.
<template>
<div class="sortable-container">
<JqxSortable ref="mySortable" :containment="'.sortable-container'">
<div class="sortable-item">Nancy Davolio</div>
<div class="sortable-item">Andrew Fuller</div>
<div class="sortable-item">Janet Leverling</div>
<div class="sortable-item">Margaret Peacock</div>
<div class="sortable-item">Steven Buchanan</div>
</JqxSortable>
</div>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable {
margin: 2px;
padding: 5px;
width: 200px;
border: lightblue solid 2px;
float: left;
}
.sortable-item {
border-radius: 5px;
padding: 5px;
background-color: white;
color: black;
}
.sortable-item:hover {
background-color: #356aa0;
color: white;
}
</style>
|
|
cursor
# |
String
|
'auto'
|
Defines the cursor that is being shown while sorting.
<template>
<JqxSortable ref="mySortable" :cursor="'move'">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
cursorAt
# |
Object
|
false
|
Moves the sorting element or helper so the cursor always appears to drag from the same position. Coordinates can be given as a hash using a combination of one or two keys: { top, left, right, bottom }.
<template>
<JqxSortable ref="mySortable" :cursorAt="{ left: 5, top: 5 }">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
delay
# |
Number
|
0
|
Time in milliseconds to define when the sorting should start. Adding a delay helps preventing unwanted drags when clicking on an element.
<template>
<JqxSortable ref="mySortable" :delay="500">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
disabled
# |
Boolean
|
false
|
Disables the widget if set to true.
<template>
<JqxSortable ref="mySortable" :disabled="true">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
distance
# |
Number
|
1
|
Tolerance, in pixels, for when sorting should start. If specified, sorting will not start until after mouse is dragged beyond distance. Can be used to allow for clicks on elements within a handle.
<template>
<JqxSortable ref="mySortable" :distance="10">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
dropOnEmpty
# |
Boolean
|
true
|
If false, items from this sortable can't be dropped on an empty connect sortable.
<template>
<div>
<JqxSortable ref="mySortable1Ref" :autoCreate="false"></JqxSortable>
<JqxSortable ref="mySortable2Ref" :autoCreate="false"></JqxSortable>
</div>
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
const mySortable1Ref = ref(null);
const mySortable2Ref = ref(null);
const options = ref({ connectWith: '.sortable', dropOnEmpty: false, opacity: 0.5 });
const firstNames = ref(['Nancy', 'Andrew', 'Janet', 'Margaret', 'Steven']);
const lastNames = ref(['Davolio', 'Fuller', 'Leverling', 'Peacock', 'Buchanan']);
function loadInfo() {
let sortableList1 = '';
let sortableList2 = '';
for (let i = 0; i < this.firstNames.length; i++) {
const element = '<div>' + this.firstNames[i] + ' ' + this.lastNames[i] + '</div>';
sortableList1 = sortableList1 + element;
}
const mySortable1 = mySortable1Ref.value.$el;
const mySortable2 = mySortable2Ref.value.$el;
mySortable1.classList.add('sortable');
mySortable2.classList.add('sortable');
mySortable1.innerHTML = sortableList1;
mySortable2.innerHTML = sortableList2;
}
onMounted(() => {
loadInfo();
mySortable1Ref.value.createComponent(options.value);
mySortable2Ref.value.createComponent(options.value);
});
</script>
<style>
.jqx-sortable {
margin: 2px;
padding: 5px;
float: left;
width: 200px;
border: lightblue solid 1px;
margin-right: 30px;
}
.jqx-sortable div {
border-radius: 5px;
padding: 5px;
cursor: pointer;
background-color: white;
color: black;
border: 1px solid transparent;
}
.jqx-sortable div:hover {
border: 1px solid #356aa0;
}
</style>
|
|
forceHelperSize
# |
Boolean
|
false
|
If true, forces the helper to have a size.
<template>
<JqxSortable ref="mySortable" :forceHelperSize="true">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
forcePlaceholderSize
# |
Boolean
|
false
|
Sets or gets the displaying of the popover's arrow.
<template>
<JqxSortable ref="mySortable" :forcePlaceholderSize="true">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
grid
# |
Array
|
[ 0, 0 ]
|
Snaps the sorting element or helper to a grid, every x and y pixels.
<template>
<JqxSortable ref="mySortable" :grid="[50, 50]">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
handle
# |
String
|
false
|
Restricts sort start click to the specified element.
<template>
<JqxSortable ref="mySortable1" :handle="'.handle'">
<div class="sortable-item">
<div class="handle">Drag me</div>
<div>Nancy Davolio</div>
</div>
<div class="sortable-item">
<div class="handle">Drag me</div>
<div>Andrew Fuller</div>
</div>
<div class="sortable-item">
<div class="handle">Drag me</div>
<div>Janet Leverling</div>
</div>
<div class="sortable-item">
<div class="handle">Drag me</div>
<div>Margaret Peacock</div>
</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable {
margin: 2px;
padding: 5px;
width: 200px;
border: lightblue solid 2px;
float: left;
}
.sortable-item {
border-radius: 5px;
padding: 5px;
background-color: white;
color: black;
}
.sortable-item:hover {
background-color: #356aa0;
color: white;
}
.handle {
color: lightgray;
}
</style>
|
|
helper
# |
String
|
'original'
|
Allows for a helper element to be used for dragging display.
<template>
<JqxSortable ref="mySortable" :helper="'clone'">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
items
# |
String
|
'> *'
|
Specifies which items inside the element should be sortable.
<template>
<JqxSortable ref="mySortable1" :items="'.sortable-item'">
<div class="item">Members</div>
<div class="sortable-item">Nancy Davolio</div>
<div class="sortable-item">Andrew Fuller</div>
<div class="sortable-item">Janet Leverling</div>
<div class="sortable-item">Margaret Peacock</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable {
margin: 2px;
padding: 5px;
width: 200px;
border: lightblue solid 2px;
float: left;
}
.sortable-item {
border-radius: 5px;
padding: 5px;
background-color: white;
color: black;
}
.item {
border-radius: 5px;
padding: 5px;
background-color: #578aa0;
color: white;
}
.sortable-item:hover {
background-color: #356aa0;
color: white;
}
</style>
|
|
opacity
# |
Number
|
false
|
Defines the opacity of the helper while sorting. From 0.01 to 1.
<template>
<JqxSortable ref="mySortable" :opacity="0.5">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
placeholderShow
# |
String
|
"original"
|
A class name that gets applied to the otherwise white space.
<template>
<JqxSortable ref="mySortable" :placeholderShow="'sortable-placeholder'">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
revert
# |
Boolean
|
false
|
Whether the sortable items should revert to their new positions using a smooth animation.
<template>
<JqxSortable ref="mySortable" :revert="true">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
scroll
# |
Boolean
|
true
|
If set to true, the page scrolls when coming to an edge.
<template>
<JqxSortable ref="mySortable" :scroll="false">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
scrollSensitivity
# |
Number
|
20
|
Defines how near the mouse must be to an edge to start scrolling.
<template>
<JqxSortable ref="mySortable" :scrollSensitivity="10">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
scrollSpeed
# |
Number
|
20
|
Allows for a helper element to be used for dragging display.
<template>
<JqxSortable ref="mySortable" :scrollSpeed="40">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
theme
# |
String
|
''
|
Sets the widget's theme.
<template>
<JqxSortable ref="mySortable"
:theme="'material'">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center; font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
tolerance
# |
String
|
'intersect'
|
Specifies which mode to use for testing whether the item being moved is hovering over another item.
<template>
<JqxSortable ref="mySortable" :tolerance="'pointer'">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
zIndex
# |
Number
|
1000
|
Allows for a helper element to be used for dragging display.
<template>
<JqxSortable ref="mySortable" :zIndex="2000">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
|
|
activate
# |
Event
|
|
This event is triggered on drag start when are used connected lists.
Code examples #
Bind to the activate event of jqxSortable.
<template>
<JqxSortable ref="mySortable" @activate="onActivate($event)">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
function onActivate(event) {
alert('do something...');
}
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
beforeStop
# |
Event
|
|
This event is triggered when sorting stops, but when the placeholder/helper is still available.
Code examples #
Bind to the beforeStop event of jqxSortable.
<template>
<JqxSortable ref="mySortable" @beforeStop="onBeforeStop($event)">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
function onBeforeStop(event) {
alert('do something...');
}
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
change
# |
Event
|
|
This event is triggered when the DOM position of an item is changed.
Code examples #
Bind to the change event of jqxSortable.
<template>
<JqxSortable ref="mySortable" @change="onChange($event)">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
function onChange(event) {
alert('do something...');
}
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
deactivate
# |
Event
|
|
This event is triggered when sorting was stopped, is propagated to all possible connected lists.
Code examples #
Bind to the deactivate event of jqxSortable.
<template>
<JqxSortable ref="mySortable" @deactivate="onDeactivate($event)">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
function onDeactivate(event) {
alert('do something...');
}
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
out
# |
Event
|
|
This event is triggered when a sortable item is moved away from a sortable list.
Code examples #
Bind to the out event of jqxSortable.
<template>
<JqxSortable ref="mySortable" @out="onOut($event)">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
function onOut(event) {
alert('do something...');
}
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
over
# |
Event
|
|
This event is triggered when a sortable item is moved into a sortable list.
Code examples #
Bind to the over event of jqxSortable.
<template>
<JqxSortable ref="mySortable" @over="onOver($event)">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
function onOver(event) {
alert('do something...');
}
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
receive
# |
Event
|
|
This event is triggered when an item from a connected sortable list has been dropped into another list.
Code examples #
Bind to the receive event of jqxSortable.
<template>
<JqxSortable ref="mySortable" @receive="onReceive($event)">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
function onReceive(event) {
alert('do something...');
}
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
remove
# |
Event
|
|
This event is triggered when a sortable item from the list has been dropped into another.
Code examples #
Bind to the remove event of jqxSortable.
<template>
<JqxSortable ref="mySortable" @remove="onRemove($event)">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
function onRemove(event) {
alert('do something...');
}
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
sort
# |
Event
|
|
This event is triggered during sorting.
Code examples #
Bind to the sort event of jqxSortable.
<template>
<JqxSortable ref="mySortable" @sort="onSort($event)">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
function onSort(event) {
alert('do something...');
}
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
start
# |
Event
|
|
This event is triggered when sorting starts.
Code examples #
Bind to the start event of jqxSortable.
<template>
<JqxSortable ref="mySortable" @start="onStart($event)">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
function onStart(event) {
alert('do something...');
}
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
stop
# |
Event
|
|
This event is triggered when sorting has stopped.
Code examples #
Bind to the stop event of jqxSortable.
<template>
<JqxSortable ref="mySortable" @stop="onStop($event)">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
function onStop(event) {
alert('do something...');
}
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
update
# |
Event
|
|
This event is triggered when the user stopped sorting and the DOM position has changed.
Code examples #
Bind to the update event of jqxSortable.
<template>
<JqxSortable ref="mySortable" @update="onUpdate($event)">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
function onUpdate(event) {
alert('do something...');
}
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
|
| Name | Arguments | Return Type |
|
cancel
# |
None
|
None
|
Cancels a change in the current sortable and reverts it to the state prior to when the current sort was started.
<template>
<JqxSortable ref="mySortable">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
const mySortable = ref(null);
onMounted(() => {
mySortable.value.cancel();
});
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
cancelMethod
# |
None
|
None
|
Cancels a change in the current sortable and reverts it to the state prior to when the current sort was started.
<template>
<JqxSortable ref="mySortable"
>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import { onMounted, ref } from "vue";
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
const mySortable = ref(null);
onMounted(() => {
mySortable.value.cancelMethod();
});
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center; font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
destroy
# |
None
|
None
|
Removes the sortable functionality.
<template>
<JqxSortable ref="mySortable">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
const mySortable = ref(null);
onMounted(() => {
mySortable.value.destroy();
});
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
disable
# |
None
|
None
|
Disables the widget.
<template>
<JqxSortable ref="mySortable">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
const mySortable = ref(null);
onMounted(() => {
mySortable.value.disable();
});
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
enable
# |
None
|
None
|
Enable the widget.
<template>
<JqxSortable ref="mySortable">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
const mySortable = ref(null);
onMounted(() => {
mySortable.value.enable();
});
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
refresh
# |
None
|
None
|
Refresh the items.
<template>
<JqxSortable ref="mySortable">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
const mySortable = ref(null);
onMounted(() => {
mySortable.value.refresh();
});
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
refreshPositions
# |
None
|
None
|
Refresh the cached positions of the sortable items.
<template>
<JqxSortable ref="mySortable">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
</JqxSortable>
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
const mySortable = ref(null);
onMounted(() => {
mySortable.value.refreshPositions();
});
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
serialize
# |
object
|
String
|
Serializes the jqxSortable item ids into a form/ajax submittable string. Calling this method produces a hash that can be appended to any url to easily submit a new item order back to the server.
<template>
<JqxSortable ref="mySortable">
<div id="sort_1">1</div>
<div id="sort_1">2</div>
<div id="sort_1">3</div>
<div id="sort_1">4</div>
<div id="sort_1">5</div>
</JqxSortable>
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
const mySortable = ref(null);
onMounted(() => {
const value = mySortable.value.serialize({ key: 'sort' });
alert(value);
});
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|
|
toArray
# |
None
|
Array
|
Serializes the jqxSortable item ids into an array of strings.
<template>
<JqxSortable ref="mySortable">
<div id="sort_1">1</div>
<div id="sort_2">2</div>
<div id="sort_3">3</div>
<div id="sort_4">4</div>
<div id="sort_5">5</div>
</JqxSortable>
</template>
<script setup>
import { onMounted, ref } from 'vue';
import JqxSortable from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxsortable.vue';
const mySortable = ref(null);
onMounted(() => {
const array = mySortable.value.toArray();
console.log(array);
});
</script>
<style>
.jqx-sortable div {
margin: 1px;
background-color: lightblue;
text-align: center;
font-size: 20px;
width: 100px;
height: 30px;
}
</style>
|