while remove the value from second listbox, this value added the first listbox

Posted by: bemes9226 on 12 January 2021, 11:18 pm EST

  • Posted 12 January 2021, 11:18 pm EST

    selected 1st list box value added correctly in 2nd list box
    but 2nd list box selected value clicked on remove this value is not added in 1st list box.
    in debugger _view data not update current item check below screenshot.

    removeColumn=() =>{
    debugger;
    var item = this.TanantData.currentItem,
    index = this.columnsAvailable.currentPosition;
    if (item) {
    this.TanantData.remove(item);

    this.columnsAvailable.sourceCollection.splice(Math.max(0, index), 0, item);
    this.columnsAvailable._needRefresh;
    this.columnsAvailable.moveCurrentTo(item);
    }
    }


    addColumn=()=> {
    debugger;
    let arr=[];
    arr.push(this.columnsAvailable.currentItem);
    var item = this.columnsAvailable.currentItem,
    index = this.TanantData.currentPosition;
    if (item) {
    this.columnsAvailable.remove(item);
    this.TanantData.sourceCollection.splice(Math.max(0, index), 0, item);
    this.TanantData.moveCurrentTo(item);
    }
    }
  • Replied 13 January 2021, 8:27 pm EST

    Hi bemes9226,

    You need to call the refresh method of the CollectionView after adding the item using the splice method:
    this.columnsAvailable.sourceCollection.splice(Math.max(0, index), 0, item);
    this.columnsAvailable.refresh();
    this.columnsAvailable.moveCurrentTo(item);

    Regards,
    Ashwin

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels