Jump to content

How to add JavaScript to a TextArea, using IronPython?


Anne SAINT-AMANS

Recommended Posts

  • 4 months later...

Hello Anne,

Here is how you can associate a JavaScript to a given TextArea

# Attach and existing JavasSript from the Applicatin Document to a text areafrom Spotfire.Dxp.Application.Scripting import HtmlTextAreaScript # 1. Get the script from the Documentscript = Application.Document.ScriptManager.TryGetScript("myJavaScript" )[1] # 2. Prepare the script for the text areahtmlScript = HtmlTextAreaScript(script,{})  # 3. Attach the script to the TextArea. ta is a TextArea Visualization script parameterfrom Spotfire.Dxp.Application.Visuals import HtmlTextAreavis = ta.As[HtmlTextArea]()vis.Scripts.Add(htmlScript)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...