UI Page Dialog window Size
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2023 04:29 AM
Hi,
I have created a UI Page where I am dynamically displaying the data in my UI Page.
So far I have been able to get the data displayed in my UI Page, but the problem which I am facing is regarding the size of the popup.
Based on content how can I make it auto fit to the content? Right now for some it is showing properly but for some it's going out of Browser window size.
My code below:
I am populating Description from Client script of my UI page to HTML based on help done by Ankur. Below is my code:
UI Page HTML:
<div>
<b>Description</b>
<br/>
<br/>
<pre><p id="description"></p></pre>
</div>
UI Page Client Script:
populateDetails();
function populateDetails() {
var getDetails = new GlideAjax('SI Name');
getDetails.addParam('sysparm_name', 'Function Name');
getDetails.addParam('sysparm_recordID', g_form.getUniqueValue());
getDetails.addParam('sysparm_record_table', g_form.getTableName());
getDetails.getXMLAnswer(getDetails);
}
function getDetails(answer) {
var parseEmail = JSON.parse(answer);
document.getElementById('description').innerHTML = parseEmail.body;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2023 04:53 AM
set the size
var dialog = new GlideDialogWindow("sc_cat_item_disclamer"); //create "Terms and Conditions" dialog window
dialog.setTitle(getMessage('disclamer_title')); //Set the dialog title
dialog.setSize(600,600); //Set the dialog size
dialog.removeCloseDecoration(); //remove the close cross from the dialogwindow
dialog.render(); //Open the dialog
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-26-2023 07:00 AM
The suggested method did not worked for me. It is still not automatically adjusting based on the content and is going outside the page.
Any other alternative suggestions from your end?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-28-2023 08:33 PM
how does it look like?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-09-2023 04:25 AM
Unfortunately, due to client restrictions I will not be able to share the image here.
But after trying your script, there was no change in size of the dialog box, exactly same as before.
What I am looking for is to auto adjust the dialog box size based on the content which we are trying to display.
Any input on this?
Regards,
Surbhi