Dynamic Resize For Embedded IFrames
If you've ever attempted to dynamically resize your embedded iFrames in your parent application, you may have experienced a CORS conflict. Basically, since your parent application and sisense application serve from different domains, your browser restricts HTTP responses for security reasons. Luckily, we have a workaround that leverages the Window.postMessage() function. This solution dynamically resizes your embedded iFrame based on the height of the contents. // Within your SISENSE APPLICATION, apply this script on the dashboard to be embedded via iFrame: dashboard.on('refreshend', function () { var heightValue = 0, columnArr = dashboard.layout.columns, columnHeight = [], targetWindow = window.parent, // replace with your target domain targetOrigin = 'http://main.mytestapp.com:8083'; // iterate through columns for (var i = 0; i < columnArr.length; i++) { var cellsLength = columnArr[i].cells.length, heightTotal = 0; // increment through each column widget for (var j = 0; j < cellsLength; j++) { var height = columnArr[i].cells[j].subcells[0].elements[0].height; heightTotal += height; } columnHeight.push(heightTotal); // assign max aggregate column height heightValue = columnHeight.reduce(function (a, b) { return Math.max(a, b); }); } targetWindow.postMessage({ heightValue: heightValue }, targetOrigin); }); // Within your PARENT APPLICATION: window.addEventListener('message', receiveMessage, false); function receiveMessage(event) { // replace with your sisense application origin var sendingOrigin = 'http://reporting.mytestapp.com:8080'; if (event.origin !== sendingOrigin) { throw new Error('bad origin:', event.origin); } else { try { // replace with your iFrame ID document.getElementById('ifm').height = event.data.heightValue; } catch (err) { throw new Error(err.name + ':', err.message); } } }2.4KViews2likes1CommentRedirect users to different dashboards based on dashboard filters
This article discusses and shares the full code of a dashboard script that redirects users to a different dashboard ID based on the user's filter selections or initial loaded filter state. In the particular example shared in this article, the script checks whether the selected date filter (either from a members filter or a from/to filter range) includes an earlier date than the earliest date in the current dashboard's datasource. If this is the case, the script redirects the user to a specified alternate dashboard, preserving any additional URL segments and query parameters in the URL. Any other type of filter state can also be used to determine on when the script should redirect, including non-date filters using similar scripts.440Views1like0CommentsHide Widget Using Web Access Token
We have an embedded dashboard that utilizes web access token for filtering on different organizations. We have a widget that only needs to be displayed to certain organizations. Does anyone know if we can filter individual widgets using the web access tokens?Solved2.9KViews1like6Comments400 on getCustomActions with iframe embed dashboard and WAT authentication
Hello, To distribute our dashboards to our clients, we use iframes. We didn't have any issues until we started using the Web Access Token to authenticate our users. Since then, some actions in the dashboard are broken. Specifically, all actions that call the getCustomActions endpoint end with an HTTP status 400 (from blox button). Here is an example of a response (hidden tokens) Possibly unhandled rejection: {"data":{"error":{"code":5014,"message":"Endpoint is forbidden","status":400,"httpMessage":"Bad Request"}},"status":400,"config":{"method":"GET","transformRequest":[null],"transformResponse":[null],"jsonpCallbackParam":"callback","url":"/api/v1/blox/getCustomActions","headers":{"Internal":"true","x-request-id":"xxx","Accept":"application/json, text/plain, */*","Authorization":"xxx","Initialiser":{"words":[-408432632,967604053,-1185492005,-1736048623,-790530727,35211402,447656597,-1442048497],"sigBytes":32},"X-XSRF-TOKEN":"xxx"}},"statusText":"","xhrStatus":"complete"} Do you have any suggestions for resolving this issue ? Best Regards, AlexandreSolved3.3KViews1like7CommentsSync Blox Input Element with Current Filter State
When creating a Blox widget altering a filter within a dashboard or widget, it is sometimes advantageous to modify the default behavior, that upon activating a Blox action , the Blox widget input or inputs retain the recently entered values instead of reverting to the default Blox inputs set in the Blox template. Additionally, when a user has the permission to directly modify the relevant filter, bypassing Blox widget actions, and subsequently makes changes to the filter that the Blox widget is designed to manipulate, the default Blox input values may no longer match with the current state of the filter.969Views1like0CommentsAnimating Sisense Title Elements and Widgets Using CSS Animations
Animating Sisense widget elements and dashboard and widget titles is a possible way to enhance the visual appeal and user experience of a Sisense dashboard, or highlight a particular part of a dashboard or widget. Sisense widgets and titles are standard HTML elements, making it possible to apply animation using solely standard CSS stylesheets, much like other HTML elements on non-Sisense pages. Animations can include effects like fading widgets in or out and cyclic changes in text color of widgets or titles.1.5KViews1like0Comments