How to add the item of listbox on invoice onclick of button and increase and decrease quantity of item in invoice

Hello!
I want to add the item of list box  on the invoice on click of the button and also I want to increase and decrease the quantity of the item in an invoice
So please give the idea and reference for it.

1 Reply 1 reply marked as answer

MV Madhan Venkateshan Syncfusion Team July 9, 2020 08:04 AM UTC

Hi Ishan Shah, 
 
Good day to you. 
 
We suspect that you are trying add and remove items dynamically, you can use ‘addItems’ and ‘removeItems’ method to add and remove items. Please refer the below code snippets and sample link. 
 
@using Syncfusion.EJ2 
@Html.EJS().ListBox("listbox").DataSource((IEnumerable<object>)ViewBag.data).Render() 
<button class="e-btn" id="additem">Add Items</button> 
<button class="e-btn" id="removeitem">Remove Items</button> 
 
<script> 
    document.getElementById("additem").onclick = function () { 
        var items = ['Bugatti Veyron Super Sport', 'SSC Ultimate Aero']; 
        var listboxobj = document.getElementById("listbox").ej2_instances[0]; 
        listboxobj.addItems(items); 
    } 
 
    document.getElementById("removeitem").onclick = function () { 
        var items = ["Bugatti Chiron"]; 
        var listboxobj = document.getElementById("listbox").ej2_instances[0]; 
        listboxobj.removeItems(items); 
    } 
</script> 
 
 
 
If we misunderstood your requirement, please share more details. 
 
Regards, 
Madhan V 


Marked as answer
Loader.
Up arrow icon