Is there any viable way of loading an HTML frame w...
# suitescript
u
Is there any viable way of loading an HTML frame within a *suitelet form? I'm aware of Inline HTML fields, but I was looking into loading a larger div to hopefully load in an external library. any and all inputs appreciated, thanks!
b
inline html is the usual answer if you want a div
though an external library is usually unrelated to a div
and you have the option of using client script if it supports amd
t
@7px I've used inlinehtml to pull in chart external library.
var newChart = portletObj.addField({
id: 'chart1', type: 'inlinehtml', label: 'Chart 1' }); newChart.defaultValue = "<canvas id='newChart' width='400' height='600'></canvas>" //Creates the canvas for the chart.js to use
then in the helper.js I grab the newChart element and pull in the chart.js to display everything.
var thisChart = document.getElementById('newChart').getContext('2d'); //This element ID is defined in the Portlet as an Inline HTML element of canvas type
That was used to create a bar chart for sales order values in a portlet, but could also be used in a suitelet