I've encountered a peculiar issue with my user interface. I have a barcode scanner on my phone that scans barcodes and stores them in an observable array (which is functioning correctly). I also have a label that displays the length of the array. When I add new items, the label updates accordingly until the length reaches 10, at which point it stops displaying properly on the UI.
The code snippet for the Label component:
<Label length="4" text="{{ qty }}" />
JavaScript logic:
var qty = dockReceive.wayBills.length;
dockReceive.set("qty", qty);
Model class - dockReceive:
var observableModule = require("data/observable");
var observableArrayModule = require("data/observable-array");
function DockReceive(info) {
info = info || {};
console.log("in dock receive");
var viewModel = new observableModule.fromObject({
wayBills: info.wayBills || new observableArrayModule.ObservableArray(),
qty: info.qty || 0,
});
return viewModel;
}
module.exports = DockReceive;
If anyone can assist me in resolving this unusual problem, I would greatly appreciate it.