How to modify Factbox width in webclient?

Eboy82
Member Posts: 25
Does anyone know the secret how to modify the width of factbox area in webclient?
I have a control-add displaying a PDF using pdf.js - works very nice in Windows Client, but I can't get it to work in web-client, as it's seems locked to it's default width no matter what I try with my control-addin.
I know the CSS parameter to change, but this is for BC SAAS, so I don't know how to "override" those parameters.
@media screen and (min-width: 1367px)
.ms-nav-layout-wide .ms-nav-layout-page-embedded .ms-nav-layout-aside-right)
In this i modify
flex-basis: 50%; and factbox takes up 50 %;
I have a control-add displaying a PDF using pdf.js - works very nice in Windows Client, but I can't get it to work in web-client, as it's seems locked to it's default width no matter what I try with my control-addin.
I know the CSS parameter to change, but this is for BC SAAS, so I don't know how to "override" those parameters.
@media screen and (min-width: 1367px)
.ms-nav-layout-wide .ms-nav-layout-page-embedded .ms-nav-layout-aside-right)
In this i modify
flex-basis: 50%; and factbox takes up 50 %;
0
Answers
-
In BC16 it's still not possible to "drag an change" the width of the factbox-area....Did anyone come up with a solution? We are facing the same challenge as Eboy82 with size of a PDF viewer...0
-
I'm not really in control-addins at this moment but, if the problem is to override your parameter over the standard css your can add "!important" after your code.
Like:flex-basis: 50% !important;
I don't know if it's what your are asking.
I'm anyway really curious to try it, can you provide a sample app or anything so I can try it in my environment?0 -
yeah, i managed to overcome it through a hack of the CSS as well.
I used the example here as a startup.
https://www.kauffmann.nl/2019/01/22/pdf-viewer-in-business-central/
I've made some changes to the following in script.js - that sets the factbox area to fixed size of 725.
var __ViewerFrame;
var __ViewerOrigin;
//FACTBOXFIX
var myFrame = null;
var factBoxPaneContainer = null;
var parentBody = null;
//FACTBOXFIX
function InitializeControl(url) {
__ViewerOrigin = getViewerOrigin(url);
window.addEventListener("message", onMessage, false);
var controlAddIn = document.getElementById('controlAddIn');
controlAddIn.innerHTML = '<iframe id="viewer" style="border-style: none; margin: 0px; padding: 0px; height: 100%; width: 100%" allowFullScreen></iframe>'
__ViewerFrame = document.getElementById('viewer');
__ViewerFrame.src = url;
//FACTBOXFIX
parentBody = window.parent.document.body;
iframes = $('iframe', parentBody);
for (var i = 0; i < iframes.length; i++) {
var parentBody = $("#viewer", iframes.eq(i).contents());
if (parentBody.length === 1)
myFrame = iframes.eq(i);
}
//Factbox width and margin
factBoxPaneContainer = myFrame.closest(".ms-nav-layout-aside-right,.aside-area-box");
factBoxPaneContainer.css( { "flex-basis" : 725} );
factBoxPaneContainer.css( { "margin" : 5} );
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