Importing a JS-Library

Tagged:
  • r013
    Teilnehmer
      vor 7 Jahren, 8 Monaten #10103

      Hi,

      i was wondering how to import external libraries like “Crypto.js” or “Chart.js”

      what do i have to do to import these libraries successfully into my simplifier instance.

      Cheers!

      Mathieu Roll
      Administrator
        Has successfully completed the online course Introduction
        Has successfully completed the online course Intermediate (200)
        Has successfully completed the online course Advanced (300)
        Has successfully completed the online course Basics (100)
      vor 7 Jahren, 8 Monaten #10106
      Up
      1
      Down
      ::

      Hi,

      you can Add a Javascript Lib under Applications.

      There is a Tab Libraries where you can create a new Library and Upload your Library in Zip Format.

      In the JS-Code input Field you need to Define wich Scripts should be Loaded.

      You can add Script with the addScript(‘<library-file-name.js>’, ‘<library-name>’); function and
      CSS files with addStyle(‘<library-file-name.css>’, ‘<library-name>’);

      After you created the Library you can use it in you Application by adding it under Libraries

      But you can use it in Widgets too.

      Denis Simon
      Teilnehmer
        vor 6 Jahren, 7 Monaten #18151
        Up
        1
        Down
        ::

        Hi,

        i have added a library to my application as explained above.

        It mainly contains simple utilities like lodash etc.

        Now i want to use some library functions in my screens/controllers.

        How do i import the library namespace during runtime to call a function?

        Is it possible to use an external library within a script in the process designer?

        Any code i write in the code designer (IDE)  in generated controllers gets deleted when the app is redeployed. Why does this happen?

        I am not sure how to define a external library inside a controller.

         

        I would really appreciate it if you could explain the recommended approach to me in a few sentences.

        Thanks in advance.

         

        Mathieu Roll
        Administrator
          Has successfully completed the online course Introduction
          Has successfully completed the online course Intermediate (200)
          Has successfully completed the online course Advanced (300)
          Has successfully completed the online course Basics (100)
        vor 6 Jahren, 7 Monaten #18203
        Up
        0
        Down
        ::

        Hello,

        i have a library named helperFunctions wich is registering a object helperFunctions in the window object.

        The library is zipped and has only one js file.

        Now create a new library within Simplifier Upload the Zip file and add the script wich is within the zip file.

        After this you can add the Library within your application.

        And now you can use the Library within a script shape in the Process Designer.

        Denis Simon
        Teilnehmer
          vor 6 Jahren, 6 Monaten #18304
          Up
          0
          Down
          ::

          Thank you very much for the detailed explanation!

           

          Chris Bouveret
          Administrator
            Has successfully completed the online course Introduction
            Has successfully completed the online course Intermediate (200)
            Has successfully completed the online course Advanced (300)
            Has successfully completed the online course Basics (100)
            Has successfully completed the online course Advanced (320)
            Has successfully completed the Intermediate Certification
            Has successfully completed the Advanced Certification
          vor 6 Jahren, 6 Monaten #18306
          Up
          0
          Down
          ::

          Addon: the mentioned library “lodash” is also included for use within Server Side Business Objects as of the latest Simplifier 4.5 Hotfix which should be available on any freemium instance.

        Ansicht von 6 Beiträgen – 1 bis 6 (von insgesamt 6)

        You must be logged in to reply to this topic.