JavaScript Add-In ascertain height?

bernd_swiss
Member Posts: 3
I have a simple Add-In to show html text in a page (NAV2013 R2).
Explanation:
I give the text from NAV to the Add-In with function "DataFromCALToJavaScript".
The Add-In shows the Text in the page.
Problem:
With long text, the Add-In shows no scrollbar.
But...
When I have a link in the html text and I click on it (in the page)...a have the scrollbar...all is wonderful.
Question:
What can I do to have the same? I would like to have a resized Add-In with scrollbar.
The size in the NAV-Page is not static, I can not start the add-in with fixed height.
Page:
Code:
Visual Studio Class
Manifest.xml
JavaScript: Control.js
Explanation:
I give the text from NAV to the Add-In with function "DataFromCALToJavaScript".
The Add-In shows the Text in the page.
Problem:
With long text, the Add-In shows no scrollbar.
But...
When I have a link in the html text and I click on it (in the page)...a have the scrollbar...all is wonderful.
Question:
What can I do to have the same? I would like to have a resized Add-In with scrollbar.
The size in the NAV-Page is not static, I can not start the add-in with fixed height.
Page:
Code:
Visual Studio Class
using Microsoft.Dynamics.Framework.UI.Extensibility; namespace Microsoft.Dynamics.Nav.Custom { [ControlAddInExport("ShowHTMLwithNAV")] public interface ControlAddIn { [ApplicationVisible] event ApplicationEventHandler ControlAddInReady; [ApplicationVisible] void DataFromCALToJavaScript(object data); } }
Manifest.xml
<?xml version="1.0" encoding="utf-8" ?> <Manifest> <Resources> <Script>Control.js</Script> </Resources> <ScriptUrls> <ScriptUrl>http://code.jquery.com/jquery-1.9.1.min.js</ScriptUrl> </ScriptUrls> <Script> <![CDATA[ $(document).ready(function() { InitializeControl(); Microsoft.Dynamics.NAV.InvokeExtensibilityMethod('ControlAddInReady', null); }); ]]> </Script> <VerticalStretch>true</VerticalStretch> <HorizontalStretch>true</HorizontalStretch> </Manifest>
JavaScript: Control.js
function InitializeControl() { } function DataFromCALToJavaScript(data) { $("#controlAddIn").empty(); $("#controlAddIn").append(data); }
0
Answers
-
I think it is limitation of the JAvaScript addin - because the size of the addin is defined in the manifest, you cannot change it in run-time. It is biggest issue to have some generic addin. I remember Vjeko talking about this on NAVTechDays...0
-
Thanks for this information.
It is not the solution that I hoped for.
I hope Microsoft give a solution in a next release for a better integration with JavaScript.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions