Vue UI Components Documentation
The Vue PickList moves items between an available list and a selected list, with buttons, a double-click or the keyboard. This guide adds the Vue PickList (jqxPickList) to an app, then shows how to set its options, handle its events and call its methods.
jqwidgets-scriptsjqwidgets-scripts/jqwidgets-vue3/vue_jqxpicklist.vue 
In a Vue 3 project (to start one, see Getting started with Vue), add the package:
npm install jqwidgets-scripts
import JqxPickList from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxpicklist.vue';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.base.css';
import 'jqwidgets-scripts/jqwidgets/styles/jqx.tailwind-blue-dark.css';
With <script setup>, an imported component is ready to use in the template. jqx.base.css is required; the second file is a theme, selected with the theme attribute.
The Default Functionality demo as a Single-File Component:
<template>
<div class="demo">
<p class="demo-hint">
Click an item to select it, <kbd>Ctrl</kbd>+click or <kbd>Shift</kbd>+click for several,
then use the arrows. Double-clicking an item moves it straight across.
</p>
<JqxPickList
ref="picklist"
:width="620"
:height="340"
:source="columns"
:selectedItems="initial"
sourceHeader="Available columns"
targetHeader="Report columns"
@change="onChange"
>
</JqxPickList>
<div class="demo-result">
<strong>Report columns, in order</strong>
<span>{{
selected.length
? selected.join(', ')
: 'No columns selected - the report would be empty.'
}}</span>
</div>
</div>
</template>
<script setup>
import { ref } from 'vue';
import JqxPickList from 'jqwidgets-scripts/jqwidgets-vue3/vue_jqxpicklist.vue';
// A report builder: every column the data set has on the left, the columns the report will
const picklist = ref(null);
const columns = ref([
'Order ID',
'Customer',
'Company',
'Country',
'City',
'Product',
'Category',
'Quantity',
'Unit price',
'Discount',
'Total',
'Order date',
'Ship date',
'Status',
'Sales rep',
'Region'
]);
const initial = ref(['Order ID', 'Customer', 'Product', 'Total', 'Order date']);
const selected = ref(['Order ID', 'Customer', 'Product', 'Total', 'Order date']);
function onChange() {
selected.value = picklist.value.getSelectedItems();
}
</script>
<style>
.demo {
font-family:
system-ui,
-apple-system,
'Segoe UI',
Roboto,
sans-serif;
font-size: 14px;
max-width: 640px;
}
.demo-hint {
margin: 0 0 12px;
color: light-dark(#555, #9aa3ae);
font-size: 13px;
}
.demo-hint kbd {
font: inherit;
padding: 1px 5px;
border: 1px solid light-dark(#c8c8c8, #3a414b);
border-radius: 4px;
background: light-dark(#f7f7f7, #252a31);
}
.demo-result {
margin-top: 14px;
padding: 10px 12px;
border: 1px solid light-dark(#e0e0e0, #2f353d);
border-radius: 6px;
background: light-dark(#fafafa, #1c2027);
line-height: 1.5;
}
.demo-result strong {
display: block;
margin-bottom: 2px;
font-size: 13px;
}
</style>Options are attributes. Bind values from the script with :, for example :width="850".
Listen to an event with @ and its name. For example, change: This event is triggered when the selected items change.
<script setup>
function onChange(event) {
console.log(event.args);
}
</script>
<template>
<JqxPickList @change="onChange" />
</template>
Call methods through a template ref. For example, val: Gets the selected values, or sets them when an array is passed.
<script setup>
import { ref, onMounted } from 'vue';
const myPickList = ref(null);
onMounted(() => {
const value = myPickList.value.val();
console.log(value);
});
</script>
<template>
<JqxPickList ref="myPickList" />
</template>
Every component also has setOptions({ … }) and getOptions('name').