Anne SAINT-AMANS Posted August 25, 2022 Share Posted August 25, 2022 Hello,I have an IronPython script which creates a TextArea. I would like to associate a JavaScript to this TextArea but I can't figure out how to do that.Thanks in advance for your help. Link to comment Share on other sites More sharing options...
Jose Leviaguirre Posted January 12, 2023 Share Posted January 12, 2023 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 More sharing options...
Anne SAINT-AMANS Posted January 19, 2023 Author Share Posted January 19, 2023 Hello @Jose Leviaguirre ,Thanks for your answer! I will test it as soon as I have the opportunity. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now