In this demo, you can reorder the Angular ListBox items by dragging a list item and dropping it above or below another item.
Loading...

Angular ListBox: Items Reorder

Reordering in Angular ListBox.

A live Angular example of jqxListBox, the jQWidgets ListBox component, with its complete source code below. It is one of 18 jqxListBox demos for Angular.

jqxListBox API used in this demo

Source code

To run it in your own app, install the package with npm install jqwidgets-ng, add these files to a standalone Angular CLI app, and add jqx.base.css and a theme to the styles in angular.json. Getting started with jqxListBox shows the setup step by step.

app.ts

import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { jqxListBoxModule } from 'jqwidgets-ng/jqxlistbox';
import { jqxDragDropModule } from 'jqwidgets-ng/jqxdragdrop';

@Component({
    imports: [CommonModule, jqxListBoxModule, jqxDragDropModule],
    selector: 'app-root',
    templateUrl: './app.html'
})

export class App {
    data: string[] = [
        "Affogato",
        "Americano",
        "Bicerin",
        "Breve",
        "Café Bombón",
        "Café au lait",
        "Caffé Corretto",
        "Café Crema",
        "Caffé Latte",
        "Caffé macchiato",
        "Café mélange",
        "Coffee milk",
        "Cafe mocha"
    ];
}

app.html

<jqxListBox #Country
            [allowDrop]="true"
            [allowDrag]="true"
            [source]="data"
            [width]="200"
            [height]="250">
</jqxListBox>

Learn more

More Angular ListBox demos