Code Monkey home page Code Monkey logo

Comments (2)

jacebenson avatar jacebenson commented on August 14, 2024
  • Create UI Script copy/paste from https://cdn.jsdelivr.net/jsbarcode/3.3.20/JsBarcode.all.min.js
  • UI Macro: barcode
  • Code:
    <?xml version="1.0" encoding="utf-8" ?>
      <j:jelly trim="false" 
               xmlns:j="jelly:core"
               xmlns:g="glide"
               xmlns:j2="null"
               xmlns:g2="null">
        <svg id="code128"></svg>
        <!--
        <svg id="ean-13"></svg>
        <svg id="ean-8"></svg>
        <svg id="ean-5"></svg>
        <svg id="ean-2"></svg>
        <svg id="upc-a"></svg>
        <svg id="code39"></svg>
        <svg id="itf-14"></svg>
        <svg id="msi"></svg>
        <svg id="pharmacode"></svg>
        -->
      </j:jelly>
  • Add onChange client script to run on load/change to generate the barcode
  • Code:
    function onChange(control, oldValue, newValue, isLoading, isTemplate) {
      /*
       * Run on load and on change.
       if (isLoading || newValue === '') {
         return;
       }
      */
      ScriptLoader.getScripts('jsbarcode.jsdbx', function() {
        console.log('onchange');
        JsBarcode("#code128", newValue);
        /*
        JsBarcode("#ean-13", "1234567890128", {format: "ean13"});
        JsBarcode("#ean-8", "12345670", {format: "ean8"});
        JsBarcode("#ean-5", "12345", {format: "ean5"});
        JsBarcode("#ean-2", "12", {format: "ean2"});
        JsBarcode("#upc-a", "123456789012", {format: "upc"});
        JsBarcode("#code39", "Hello", {format: "code39"});
        JsBarcode("#itf-14", "1234567890123", {format: "itf14"});
        JsBarcode("#msi", "123456", {format: "msi"});
        JsBarcode("#pharmacode", "12345", {format: "pharmacode"});
        */
      });
    }

from jace.pro.

jacebenson avatar jacebenson commented on August 14, 2024

Posted: https://blog.jacebenson.com/post/2018-11-25-barcodes/

from jace.pro.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.