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

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

    • Post Options:
    • Link

    Posted 12 January 2021, 11:18 pm EST - Updated 3 October 2022, 5:48 am 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);

    }

    }

  • Posted 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

  • Posted 17 January 2021, 4:31 am EST

    thanks

Need extra support?

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

Learn More

Forum Channels