Updating the selected data from wijmo listbox

Posted by: nivishapanwar on 22 January 2021, 11:45 am EST

    • Post Options:
    • Link

    Posted 22 January 2021, 11:45 am EST

    Hello,

    How can I update the selected data from listbox and then again add it to the listbox after clicking update button.

    After selecting the data , it’s getting displayed in textbox and then after updating that data in textbox , it should be added to listbox again.

    Regards,

    Nivisha

  • Posted 25 January 2021, 8:04 am EST

    Hi Nivisha,

    You may update the underlying data source of listbox as required and then call the refresh method on the listBox’s collectionview to update its context according to the new data. Please refer to the following code snippet and the sample demonstrating the same:

    let textBoxValue = document.getElementById("inp").value || "";
      if (textBoxValue) {
        let cv = lb.collectionView;
        // update selected item
        cv.items[lb.selectedIndex] = textBoxValue;
        // refresh to show changes
        cv.refresh();
      }
    

    https://codesandbox.io/s/wijmo-starter-forked-0wbd4?file=/src/index.js

    Regards

    Sharad

  • Posted 29 January 2021, 3:54 am EST

    Hello Sharad,

    Thank you for the help,the solution worked for my project.

    Regards,

    Nivisha

Need extra support?

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

Learn More

Forum Channels