lindell / lindell/JsBarcode

Creating a List of barcodes

Open
#313 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
5.9k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

When I loop through the number of barcodes that I need to generate, I get that the barcode will print the number of those barcodes but the the text remains the same. I also need to change the text.
e.g.

for (var i = 0; i < copies; i++) {
let finalCode = "";
const codeNumeber = i + 1;
finalCode = code.concat(codeNumeber);

console.log(finalCode);
var line = document.createElement("img");
line.setAttribute("id", "barcode");
document.getElementById("barcodeClass").appendChild(line);
JsBarcode("#barcode", finalCode, {
fontOptions: "bold",
width: 1
});

}

will print
![image](https://user-images.githubusercontent.com/6651034/67301852-acd1ad00-f4f8-11e9-9f9c-cbf511992102.png)

Contributor guide

Open the contributing guide

Research direction

Start with the browser usage shown in the issue and inspect how JsBarcode handles repeated rendering into elements selected by an id. Reproduce the loop with distinct barcode values and verify that each generated barcode displays its own value rather than reusing the first element's text.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.