I’m using Vuetify 2 and I am trying to get the row values from a given value. I’m am using a barcode scanner as a keyboard input so I can change the packed quantity when the barcode is scanned. I am trying to use the Customer_barcode as the value to find the other data with in the same row.
The example date is received and stored in a object called “items:[]”
headers: [ { text: "Image", value: "image", sortable: false, }, { text: "Item", align: "start", value: "Line_Number" }, { text: "Part Number", value: "EI_Number" }, { text: "Qty ToPack", value: "Qty_Backordered" }, { text: "Qty Packed", value: "Qty_To_Ship" }, { text: "barcode", value: "Customer_barcode", align: " d-none" }, ]
I am then able to get the customer barcode using a text-field that grabs the barcode with a method using this function below. Then I would like to add the quantity each time a barcode is scanned by getting the row data and modifying it. But I am unable to get the rows’ data.
‘handleBarcodeInput(event) {
const scannedbarcode = event.target.value;
console.log("Detected Barcode:", scannedbarcode);
// console.log("Detected length:", scannedbarcode.length);
if (this.scannedbarcode.length <= 8) {
this.barcode = "";
return this.barcode;
}
if (this.scannedbarcode !== null && this.scannedbarcode.length >= 9) {
const item = this.items.find(item => items.Customer_barcode === scannedbarcode);<- doesn't work
console.log(item); <- undefined
// scannedbarcode = "";
// return scannedbarcode;
}
}'
I cannot seem to find the answer to this question anywhere. Any help would be greatly appreciated. Thank you,