Announcement

Collapse
No announcement yet.

How do you Globalize Javascript Objects?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do you Globalize Javascript Objects?

    How do you make javascript objects/functions available across EFS scripts like you do with MAStudy and MACDStudy?

    I've created several complex javascript objects that I would like to use in my scripts the same way your built-in objects are used. For example,

    var myObj = new MyObj();

    Right now I'm placing the entire object definition in each script above where the object is instantiated but this is becoming a maintenance nightmare. Whenever I make changes to an object definition in one script, I've got to make the same change in all the other scripts that use the same object.

    Thanks,
    Kent

  • #2
    Hello Kent,

    Creating "globalized" objects from within EFS is not possible. Are you familiar with our EFS functions, setGlobalValue(), getGlobalValue(), removeGlobalValue(), call() and callFunction()? We may be able to develop an alternative routine using a combination of these functions with some global arrays objects. We could use multidimensional global arrays to store properties and formula data. Then use call() or callFunction() to store predefined routines or methods in which we could pass your formula data to for processing. That way, when you make a change to your methods you only need to change the code in one formula. Let me know how I can help.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      Jason,

      I've considered using the options you have suggested but that creates another level of complexity that I'd like to avoid.

      How does Mesa and other third-party study providers expose their objects across scripts? If you look at "eSignal/Formulas/Advanced/MESA Software/eMESA1.efs", a new study is created based on the MesaTMF1() class. Is there a development kit or documentation that explains how to expose classes, such as MesaTMF1(), or is that propritary information? Do you have to become an eSignal “partner” to receive this capability?

      Thanks for your reply and suggestions,
      Kent

      Comment


      • #4
        Hello Kent,

        Study objects such as MesaTMF1() has to be added to our JavaScript version by our development team. If you are interested in having your formulas developed as third-party add-ons like Mesa, send me a private message with your contact info and I’ll forward your request to the appropriate people.
        Jason K.
        Project Manager
        eSignal - an Interactive Data company

        EFS KnowledgeBase
        JavaScript for EFS Video Series
        EFS Beginner Tutorial Series
        EFS Glossary
        Custom EFS Development Policy

        New User Orientation

        Comment

        Working...
        X