resources/assets/dual-listbox/dual-listbox-custom.js
/**
     * Removes the listItem from the selected list.
     *
     * @param {NodeElement} listItem
     */
Removes the listItem from the selected list.
Removes the listItem from the selected list .
removeSelected(listItem) {
        let index = this.selected.indexOf(listItem);
        if (index > -1) {
            this.selected.splice(index, 1);
            this.available.push(listItem);
            this._deselectOption(listItem.dataset.id);
            this.redraw();
            setTimeout(() => {
                let event = document.createEvent("HTMLEvents");
                event.initEvent("removed", false, true);
                event.removedElement = listItem;
                this.dualListbox.dispatchEvent(event);
            }, 0);
        }
    }
removeSelected ( listItem ) { let index = this . selected . indexOf ( listItem ) ; if ( index > - 1 ) { this . selected . splice ( index , 1 ) ; this . available . push ( listItem ) ; this . _deselectOption ( listItem . dataset . id ) ; this . redraw ( ) ; setTimeout ( ( ) => { let event = document . createEvent ( "HTMLEvents" ) ; event . initEvent ( "removed" , false , true ) ; event . removedElement = listItem ; this . dualListbox . dispatchEvent ( event ) ; } , 0 ) ; } }
Removes the listItem from the selected list.
Removes the listItem from the selected list .